1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Refactor HTTP context handling

This commit is contained in:
Frédéric Guillot 2018-09-03 14:26:40 -07:00
parent 88e81d4d80
commit eee1f31903
76 changed files with 434 additions and 587 deletions

View file

@ -34,9 +34,9 @@ func (m *Middleware) UserSession(next http.Handler) http.Handler {
logger.Debug("[Middleware:UserSession] %s", session)
ctx := r.Context()
ctx = context.WithValue(ctx, UserIDContextKey, session.UserID)
ctx = context.WithValue(ctx, IsAuthenticatedContextKey, true)
ctx = context.WithValue(ctx, UserSessionTokenContextKey, session.Token)
ctx = context.WithValue(ctx, request.UserIDContextKey, session.UserID)
ctx = context.WithValue(ctx, request.IsAuthenticatedContextKey, true)
ctx = context.WithValue(ctx, request.UserSessionTokenContextKey, session.Token)
next.ServeHTTP(w, r.WithContext(ctx))
}