Merge pull request #3380 from weaveworks/use-request-context

Use the Context in the request
This commit is contained in:
Bryan Boreham
2018-10-09 17:10:18 +01:00
committed by GitHub
+1 -1
View File
@@ -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)
}
}