Skip to content

When Transfer-Encoding is set, and Content-Length, close connection#475

Merged
mmerickel merged 2 commits into
mainfrom
bugfix/close-connection-chunked-cl
Jul 7, 2025
Merged

When Transfer-Encoding is set, and Content-Length, close connection#475
mmerickel merged 2 commits into
mainfrom
bugfix/close-connection-chunked-cl

Conversation

@digitalresistor

Copy link
Copy Markdown
Member

RFC9112 adds an additional requirement when parsing a request that has both content-length and transfer-encoding set, which is that the connection should be closed after a single use to avoid potential pitfalls with request smuggling/parser desync between multiple implementations.

So now we check to see if the content-length was also set, and if so, we close the connection after the request is completed.

Closes #464

RFC9112 adds an additional requirement when parsing a request that has
both content-length and transfer-encoding set, which is that the
connection should be closed after a single use to avoid potential
pitfalls with request smuggling/parser desync between multiple
implementations.

So now we check to see if the content-length was also set, and if so, we
close the connection after the request is completed.
@mmerickel
mmerickel merged commit 4c8d68e into main Jul 7, 2025
38 checks passed
@mmerickel
mmerickel deleted the bugfix/close-connection-chunked-cl branch July 7, 2025 04:41
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.

Parsing issue of HTTP requests with both Content-Length and Transfer-Encoding

2 participants