Skip to content

Decompress HTTP/1.1 responses regardless of who set Accept-Encoding - #40

Merged
bogdanfinn merged 1 commit into
bogdanfinn:masterfrom
nicorobinreal:decode-h1-by-content-encoding
Oct 27, 2026
Merged

bogdanfinn merged 1 commit into
bogdanfinn:masterfrom
nicorobinreal:decode-h1-by-content-encoding

Conversation

@nicorobinreal

@nicorobinreal nicorobinreal commented Oct 27, 2026 •

Copy link
Copy Markdown

HTTP/2 already decodes responses by their Content-Encoding, but HTTP/1.1 only does when Accept-Encoding contains gzip, so a request asking for br or zstd comes back decoded over HTTP/2 and still compressed over HTTP/1.1; this makes HTTP/1.1 behave the same way (and updates the tests that expected the old behavior).

HTTP/1.1 now decodes based on the response's actual Content-Encoding
whenever DisableCompression is false, matching the HTTP/2 path, instead
of only when "gzip" appears in Accept-Encoding (addedGzip).

(The original patch also made DecompressBody strip Content-Encoding and
Content-Length on all paths and leave identity responses untouched;
upstream's DecompressBody now does both.)
@nicorobinreal
nicorobinreal force-pushed the decode-h1-by-content-encoding branch from 380f09b to dde370b Compare October 27, 2026 00:47
@bogdanfinn
bogdanfinn merged commit a8ae93e into bogdanfinn:master Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants