Passing the correct status code when compression is disabled within the Brotli handler
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
parent
6ca4c5da5c
commit
6155c900be
2 changed files with 6 additions and 4 deletions
|
@ -160,6 +160,7 @@ func (r *responseWriter) Write(p []byte) (int, error) {
|
|||
}
|
||||
if !found {
|
||||
r.compressionDisabled = true
|
||||
r.rw.WriteHeader(r.statusCode)
|
||||
return r.rw.Write(p)
|
||||
}
|
||||
}
|
||||
|
@ -167,6 +168,7 @@ func (r *responseWriter) Write(p []byte) (int, error) {
|
|||
for _, excludedContentType := range r.excludedContentTypes {
|
||||
if excludedContentType.equals(mediaType, params) {
|
||||
r.compressionDisabled = true
|
||||
r.rw.WriteHeader(r.statusCode)
|
||||
return r.rw.Write(p)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue