Repository navigation
Conversation
A Transfer-Encoding value with a parameter, such as
"custom; level=1, chunked", failed with {:invalid_token_list, value}
because the value was parsed as a plain list of tokens. RFC 9110 10.1.4
allows parameters on a transfer coding, as a token or a quoted string.
Transfer-Encoding values are now parsed with their parameters and only
the coding names are kept, so the final coding of a response still
decides between chunked framing and reading until close. The chunked
coding defines no parameters and RFC 9112 7.1 says their presence
should be treated as an error, so chunked with parameters is still
rejected.
The same parser checks the Transfer-Encoding headers passed to request/5
with a streamed body and no Content-Length, so a value such as
"gzip;q=1" is accepted there. The fields are combined with ", " into
one value before parsing (RFC 9110 5.3). If chunked or identity is among
the codings the headers are sent unchanged, as before. Otherwise chunked
is appended to the last field, so it ends up as the final coding once.
ericmj
added this pull request to stack #530
October 16, 2026 13:03
Coverage Report for CI Build 96Coverage decreased (-0.05%) to 90.46%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions6 previously-covered lines in 3 files lost coverage.
Coverage Stats
馃挍 - Coveralls |
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.
A Transfer-Encoding value with a parameter, such as "custom; level=1, chunked", failed with
{:invalid_token_list, value}because the value was parsed as a plain list of tokens. RFC 9110 10.1.4 allows parameters on a transfer coding, as a token or a quoted string.Transfer-Encoding values are now parsed with their parameters and only the coding names are kept, so the final coding of a response still decides between chunked framing and reading until close. The chunked coding defines no parameters and RFC 9112 7.1 says their presence should be treated as an error, so chunked with parameters is still rejected.
The same parser checks the Transfer-Encoding headers passed to
request/5with a streamed body and no Content-Length, so a value such as "gzip;q=1" is accepted there. The fields are combined with ", " into one value before parsing (RFC 9110 5.3). If chunked or identity is among the codings the headers are sent unchanged, as before. Otherwise chunked is appended to the last field, so it ends up as the final coding once.