mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Fix panic during trace requests (#8448)
While Tracing requests on server, type assertion on logger.ResponseWriter caused nil pointer exception because of recordAPIStats{} being used as ResponseWriter. This PR avoids the type assertion and initializes a new logger.ResponseWriter. Fixes regression introduced in #8003
This commit is contained in:
parent
980bf78b4d
commit
10b526ed86
@ -130,7 +130,7 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ
|
||||
Headers: reqHeaders,
|
||||
Body: reqBodyRecorder.Data(),
|
||||
}
|
||||
rw, _ := w.(*logger.ResponseWriter)
|
||||
rw := logger.NewResponseWriter(w)
|
||||
rw.LogBody = logBody
|
||||
f(rw, r)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user