Skip to content

Fix GET/HEAD request bodies failing before the handler - #461

Merged
swapnil-nagar merged 3 commits into
v4.xfrom
swapnil/fixGetHeadRequestBody
Jul 27, 2026
Merged

Fix GET/HEAD request bodies failing before the handler#461
swapnil-nagar merged 3 commits into
v4.xfrom
swapnil/fixGetHeadRequestBody

Conversation

@swapnil-nagar

@swapnil-nagar swapnil-nagar commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Issue #458

Aligns the HttpRequest constructor with the existing streaming path by omitting the request body for GET/HEAD methods, so the worker no longer crashes constructing Node's global WHATWG Request (which rejects bodies on GET/HEAD). Fixes #458. Also omits the response body for null-body statuses (204/205/304) in HttpResponse to avoid the equivalent Response TypeError. Adds unit tests covering GET/HEAD body handling (incl. mixed-case methods) and null-body status responses.

@swapnil-nagar
swapnil-nagar requested a review from a team as a code owner July 27, 2026 03:57
Comment thread test/converters/toRpcHttp.test.ts
Comment thread src/http/HttpRequest.ts
@swapnil-nagar
swapnil-nagar enabled auto-merge (squash) July 27, 2026 18:06
@swapnil-nagar
swapnil-nagar merged commit e8ae585 into v4.x Jul 27, 2026
15 checks passed
@swapnil-nagar
swapnil-nagar deleted the swapnil/fixGetHeadRequestBody branch July 27, 2026 18:21
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.

RPC HttpRequest passes GET/HEAD bodies to WHATWG Request and fails before handler

2 participants