Skip to content

Commit

Permalink
middleware: Avoid hiding multiple calls to WriteHeader in compressRes…
Browse files Browse the repository at this point in the history
…ponseWriter
  • Loading branch information
mafredri authored and pkieltyka committed Aug 7, 2019
1 parent bd842df commit 4309749
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ type compressResponseWriter struct {

func (cw *compressResponseWriter) WriteHeader(code int) {
if cw.wroteHeader {
cw.ResponseWriter.WriteHeader(code) // Allow multiple calls to propagate.
return
}
cw.wroteHeader = true
Expand Down

0 comments on commit 4309749

Please sign in to comment.