1
0
Fork 0

Fix brotli response status code when compression is disabled

This commit is contained in:
Romain 2024-01-30 17:32:05 +01:00 committed by GitHub
parent 9be523d772
commit 85039e0d54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -138,6 +138,7 @@ func (r *responseWriter) Write(p []byte) (int, error) {
// If we detect a contentEncoding, we know we are never going to compress.
if r.rw.Header().Get(contentEncoding) != "" {
r.compressionDisabled = true
r.rw.WriteHeader(r.statusCode)
return r.rw.Write(p)
}