Skip to content
Myr

fix: print headers without Authorization header on broken pipe (#2528)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Zach Newburgh · committed by GitHub · parent 1297966 · Browse files · 1 file+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: thinkerou <thinkerou@gmail.com>

Diff stats

1 file+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:recovery.go+3 added-2 removed
74 unmodified lines
75 if current[0] == "Authorization" {76 headers[idx] = current[0] + ": *"77 }78 }79 headersToStr := strings.Join(headers, "\r\n")80 if brokenPipe {80 logger.Printf("%s\n%s%s", err, string(httpRequest), reset)81 logger.Printf("%s\n%s%s", err, headersToStr, reset)82 } else if IsDebugging() {83 logger.Printf("[Recovery] %s panic recovered:\n%s\n%s\n%s%s",83 timeFormat(time.Now()), strings.Join(headers, "\r\n"), err, stack, reset)84 timeFormat(time.Now()), headersToStr, err, stack, reset)85 } else {86 logger.Printf("[Recovery] %s panic recovered:\n%s\n%s%s",87 timeFormat(time.Now()), err, stack, reset)88 }
83 unmodified lines