Skip to content

Prefer chunked Transfer-Encoding over Content-Length#147

Merged
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/te-over-content-length
Jul 13, 2026
Merged

Prefer chunked Transfer-Encoding over Content-Length#147
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/te-over-content-length

Conversation

@kevinresol

Copy link
Copy Markdown
Member

IncomingRequest.parse framed the request body by Content-Length whenever that header was present, even if a chunked Transfer-Encoding was also present. Per RFC 7230 §3.3.3, if a message has Transfer-Encoding: chunked the Content-Length must be ignored and the body decoded as chunked.

  • When Content-Length is present, still decode the body as chunked if the Transfer-Encoding includes chunked.
  • Match the chunked transfer-coding token case-insensitively (both in the Content-Length and no-length branches).

Added a TestHeader case asserting that a request with both Content-Length and Transfer-Encoding: Chunked decodes the chunked body.

Made with Cursor

…uests

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol force-pushed the fix/te-over-content-length branch from 4fb6e1f to 085c6c0 Compare July 13, 2026 12:02
@kevinresol
kevinresol merged commit 9595150 into haxetink:master Jul 13, 2026
8 of 15 checks passed
@kevinresol
kevinresol deleted the fix/te-over-content-length branch July 14, 2026 05:54
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.

1 participant