Repository navigation
Conversation
A Transfer-Encoding field with no list elements, such as an empty value
or ",", failed the response with :empty_token_list and closed the
connection. For a response to HEAD this happened before the rule that
such a response has no body, and a comma-only field between two
nonempty Transfer-Encoding fields failed the response instead of being
ignored.
RFC 9110 5.6.1 allows a #transfer-coding list with zero elements, so
such a field now adds no transfer coding when the framing is chosen. A
response with only an empty Transfer-Encoding and no Content-Length has
no framing, so its body is read until the connection closes (RFC 9112
6.3). The field still counts as present: with Content-Length it's an
error, and it makes an HTTP/1.0 response, including a 1xx one, close
the connection (RFC 9112 6.1).
Transfer-Encoding values are parsed only where they decide the framing,
combined into one value as on the request side, so a malformed value no
longer fails a response to HEAD, a 204 or 304 response, or a 2xx
response to CONNECT, whose Transfer-Encoding RFC 9110 9.3.6 says to
ignore. Where it does fail, the error comes after the :headers event
(with :stream_headers the field itself can be emitted first) and not
while the header section is incomplete, other header errors in the same
section are reported instead of it, and with Content-Length the error is
:transfer_encoding_and_content_length instead of {:invalid_token_list,
value}.
On the request side, a Transfer-Encoding field with no codings passed to
request/5 with a streamed body counts as no codings: when chunked is
appended to such a last field it replaces the empty value.
ericmj
added this pull request to stack #530
October 16, 2026 13:03
Coverage Report for CI Build 33Warning No base build found for commit Coverage: 90.514%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → 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 field with no list elements, such as an empty value or ",", failed the response with
:empty_token_listand closed the connection. For a response to HEAD this happened before the rule that such a response has no body, and a comma-only field between two nonempty Transfer-Encoding fields failed the response instead of being ignored.RFC 9110 5.6.1 allows a #transfer-coding list with zero elements, so such a field now adds no transfer coding when the framing is chosen. A response with only an empty Transfer-Encoding and no Content-Length has no framing, so its body is read until the connection closes (RFC 9112 6.3). The field still counts as present: with Content-Length it's an error, and it makes an HTTP/1.0 response, including a 1xx one, close the connection (RFC 9112 6.1).
Transfer-Encoding values are parsed only where they decide the framing, combined into one value as on the request side, so a malformed value no longer fails a response to HEAD, a 204 or 304 response, or a 2xx response to CONNECT, whose Transfer-Encoding RFC 9110 9.3.6 says to ignore. Where it does fail, the error comes after the
:headersevent (with:stream_headersthe field itself can be emitted first) and not while the header section is incomplete, other header errors in the same section are reported instead of it, and with Content-Length the error is:transfer_encoding_and_content_lengthinstead of{:invalid_token_list, value}.On the request side, a Transfer-Encoding field with no codings passed to
request/5with a streamed body counts as no codings: when chunked is appended to such a last field it replaces the empty value.