@@ -146,9 +146,9 @@ func Session(cfg Options) func(next http.Handler) http.Handler {
146146 if _ , ok := GetSessionType (ctx ); ok {
147147 // Track this as a SpecialKey session for now.
148148 // TODO: Remove once node-gateway SpecialKey support is gone.
149+ w .Header ().Set (HeaderSessionType , "SpecialKey" )
149150 httplog .SetAttrs (ctx , slog .String ("sessionType" , "SpecialKey" ))
150151 requestsCounter .Inc (sessionLabels {SessionType : "SpecialKey" , RateLimited : "false" })
151-
152152 next .ServeHTTP (w , r )
153153 return
154154 }
@@ -185,7 +185,7 @@ func Session(cfg Options) func(next http.Handler) http.Handler {
185185 httplog .SetAttrs (ctx , slog .String ("account" , accountClaim ))
186186
187187 if cfg .UserStore != nil {
188- user , isAdmin , err := cfg .UserStore .GetUser (ctx , accountClaim )
188+ user , isAdmin , err := cfg .UserStore .GetUser (context . WithValue ( ctx , proto . HTTPRequestCtxKey , r ) , accountClaim )
189189 if err != nil {
190190 cfg .ErrHandler (r , w , err )
191191 return
@@ -260,6 +260,7 @@ func Session(cfg Options) func(next http.Handler) http.Handler {
260260 }
261261
262262 ctx = WithSessionType (ctx , sessionType )
263+ w .Header ().Set (HeaderSessionType , sessionType .String ())
263264 httplog .SetAttrs (ctx , slog .String ("sessionType" , sessionType .String ()))
264265
265266 ww , ok := w .(middleware.WrapResponseWriter )
0 commit comments