summaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/routes.go')
-rw-r--r--modules/caddyhttp/routes.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/caddyhttp/routes.go b/modules/caddyhttp/routes.go
index 9db4f2520..6f2371495 100644
--- a/modules/caddyhttp/routes.go
+++ b/modules/caddyhttp/routes.go
@@ -326,8 +326,10 @@ func wrapMiddleware(_ caddy.Context, mh MiddlewareHandler, metrics *Metrics) Mid
nextCopy := next
return HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
- // TODO: This is where request tracing could be implemented
- // TODO: see what the std lib gives us in terms of stack tracing too
+ // EXPERIMENTAL: Trace each module that gets invoked
+ if server, ok := r.Context().Value(ServerCtxKey).(*Server); ok && server != nil {
+ server.logTrace(handlerToUse)
+ }
return handlerToUse.ServeHTTP(w, r, nextCopy)
})
}