diff options
Diffstat (limited to 'routers/common/middleware.go')
-rw-r--r-- | routers/common/middleware.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/common/middleware.go b/routers/common/middleware.go index 7c5c72f5cc..75d3777e49 100644 --- a/routers/common/middleware.go +++ b/routers/common/middleware.go @@ -11,6 +11,7 @@ import ( "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/process" "code.gitea.io/gitea/modules/setting" "github.com/chi-middleware/proxy" @@ -22,7 +23,9 @@ func Middlewares() []func(http.Handler) http.Handler { var handlers = []func(http.Handler) http.Handler{ func(next http.Handler) http.Handler { return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { - next.ServeHTTP(context.NewResponse(resp), req) + ctx, _, finished := process.GetManager().AddContext(req.Context(), fmt.Sprintf("%s: %s", req.Method, req.RequestURI)) + defer finished() + next.ServeHTTP(context.NewResponse(resp), req.WithContext(ctx)) }) }, } |