diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-05-17 14:02:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-17 14:02:45 +0200 |
commit | 037e46bb51d67210f4928cad4dd12df3dee1fe05 (patch) | |
tree | dcaca9cde4713c866f9d5060eeab4e1c674d8aa3 /ext/http/lib.rs | |
parent | 1fa75f75c90b744d63e451519311f27ba55c21d7 (diff) |
fix(ext/http): skip auto-compression if content-encoding present (#14641)
Regression from #14552
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r-- | ext/http/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs index edc4c1e83..42211105d 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -680,8 +680,11 @@ fn should_compress(headers: &hyper::HeaderMap) -> bool { // indicates the contents of the body were negotiated based directly // with the user code and we can't compress the response let content_range = headers.contains_key(hyper::header::CONTENT_RANGE); + // assume body is already compressed if Content-Encoding header present, thus avoid recompressing + let is_precompressed = headers.contains_key(hyper::header::CONTENT_ENCODING); !content_range + && !is_precompressed && !cache_control_no_transform(headers).unwrap_or_default() && headers .get(hyper::header::CONTENT_TYPE) |