From a7a6986d73f69f8f51d69db9a95aaddf6382e9ea Mon Sep 17 00:00:00 2001 From: Zach Newburgh Date: Thu, 15 Oct 2020 10:41:35 -0400 Subject: [PATCH] fix: print headers without Authorization header on broken pipe (#2528) Co-authored-by: thinkerou --- recovery.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recovery.go b/recovery.go index d02b829..563f5aa 100644 --- a/recovery.go +++ b/recovery.go @@ -76,11 +76,12 @@ func CustomRecoveryWithWriter(out io.Writer, handle RecoveryFunc) HandlerFunc { headers[idx] = current[0] + ": *" } } + headersToStr := strings.Join(headers, "\r\n") if brokenPipe { - logger.Printf("%s\n%s%s", err, string(httpRequest), reset) + logger.Printf("%s\n%s%s", err, headersToStr, reset) } else if IsDebugging() { logger.Printf("[Recovery] %s panic recovered:\n%s\n%s\n%s%s", - timeFormat(time.Now()), strings.Join(headers, "\r\n"), err, stack, reset) + timeFormat(time.Now()), headersToStr, err, stack, reset) } else { logger.Printf("[Recovery] %s panic recovered:\n%s\n%s%s", timeFormat(time.Now()), err, stack, reset)