Skip to content

Treat HEAD requests as having no body when length framing is absent#148

Merged
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/request-nobody-methods
Jul 13, 2026
Merged

Treat HEAD requests as having no body when length framing is absent#148
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/request-nobody-methods

Conversation

@kevinresol

Copy link
Copy Markdown
Member

When a request has neither Content-Length nor Transfer-Encoding, IncomingRequest.parse returned an empty body only for GET and OPTIONS and responded with 411 Length Required for everything else. HEAD requests also normally carry no body, so they were incorrectly rejected.

Adds HEAD to the set of methods that yield an empty body when no length framing is present. Other methods still get 411 as before. (TRACE is intentionally not added since it is not part of the Method enum.)

Added a TestHeader case asserting a bare HEAD request parses to an empty body instead of failing.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol force-pushed the fix/request-nobody-methods branch from 1fef66c to 0504bde Compare July 13, 2026 12:11
@kevinresol
kevinresol merged commit bbbee76 into haxetink:master Jul 13, 2026
7 of 15 checks passed
@kevinresol
kevinresol deleted the fix/request-nobody-methods 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