mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Use the Context in the request
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@ type CtxHandlerFunc func(context.Context, http.ResponseWriter, *http.Request)
|
||||
|
||||
func requestContextDecorator(f CtxHandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := context.WithValue(context.Background(), RequestCtxKey, r)
|
||||
ctx := context.WithValue(r.Context(), RequestCtxKey, r)
|
||||
f(ctx, w, r)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user