From 225d8c51fd4465ebe5118abf907e4c3cec938f94 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 26 May 2021 08:04:12 -0700 Subject: [PATCH] fix: missing path in admin trace (#12373) PR #12360 introduced a change which seems to have added a regression, the RawPath in r.URL seems to be empty, if it is fallback to r.URL.Path instead. --- cmd/http-tracer.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/http-tracer.go b/cmd/http-tracer.go index d61181398..2a0e8af90 100644 --- a/cmd/http-tracer.go +++ b/cmd/http-tracer.go @@ -218,12 +218,17 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ Time: now, Proto: r.Proto, Method: r.Method, - Path: r.URL.RawPath, RawQuery: redactLDAPPwd(r.URL.RawQuery), Client: handlers.GetSourceIP(r), Headers: reqHeaders, } + path := r.URL.RawPath + if path == "" { + path = r.URL.Path + } + rq.Path = path + rw := logger.NewResponseWriter(w) rw.LogErrBody = true rw.LogAllBody = logBody