Use the Context in the request

This commit is contained in:
Bryan Boreham
2018-10-09 15:50:59 +00:00
parent d71a7328ed
commit 724ccd9826
+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)
}
}