Repository navigation
httpclient,httpserver: Let decompress options select individual encodings - #3935
Merged
bdarnell merged 2 commits intoNov 25, 2026
Merged
Conversation
decompress_response may now be a collection of content-coding names
(e.g. {"gzip", "br"}) in addition to a bool. True keeps each client's
existing default (gzip for simple_httpclient; gzip and deflate for
curl_httpclient), and names a client cannot decode are ignored.
curl_httpclient now enforces the set. Once any decoding is enabled,
libcurl decodes whatever Content-Encoding the server names, whether or
not it was requested, so a server could reach libcurl's brotli (or
zstd) decoder even though we only ever asked for gzip and deflate. The
header callback now fails the transfer if the response uses an
encoding that was not enabled, before any body reaches a decoder. This
limits exposure to decoder bugs such as CVE-2026-111497 to applications
that opt in to the affected encoding.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Kx6jxnmXgCEx18zZkgvPd
Mirror the previous change to HTTPRequest.decompress_response on the server side: HTTPServer's decompress_request (and HTTP1ConnectionParameters.decompress, which also serves simple_httpclient) now accepts a collection of content-coding names as well as a bool. gzip is still the only encoding implemented, so this only matters for applications that want to say so explicitly, but it gives future encodings a way to be enabled individually rather than all at once. The helper that interprets these options moves to httputil so both sides share it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Kx6jxnmXgCEx18zZkgvPd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
More precise control over compression methods can be useful to mitigate the impact of vulnerabilities such as the Oct 2026 vulnerability in Brotli.