Add copy error messages with request id

This commit is contained in:
dwrz
2026-07-05 18:14:40 +00:00
parent 112d994113
commit 0345dab110
3 changed files with 21 additions and 6 deletions

View File

@@ -211,7 +211,6 @@ func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
slog.String("path", r.URL.Path),
))
)
// Log completion time.
defer func() {
log.InfoContext(
@@ -249,6 +248,9 @@ func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.InfoContext(ctx, "handling")
// Always set request ID header.
w.Header().Set("X-Request-ID", id)
// Pass the request on to the multiplexer.
svc.mux.ServeHTTP(w, r)
}