Repository navigation
Conversation
umeraamir69
reviewed
Nov 2, 2026
umeraamir69
left a comment
There was a problem hiding this comment.
The urlencoded rewrite path was the gap. Multipart already deletes content-length (and content-type for the new boundary) before rebuilding the Request. Dropping content-length here after stripping the override field matches that, and the test that expects contentLength null after removing _method or a custom form name is the right check.
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.
Removing the override field from a URLencoded form changes its body length, but the rewritten request keeps the incoming
Content-Length. For_method=DELETE&message=Hello, the body shrinks from 28 to 13 bytes. Forwarding it through Node'sfetchthen fails withUND_ERR_REQ_CONTENT_LENGTH_MISMATCH.Drop the stale header when rebuilding the form request, matching the existing multipart branch. Keep the content type and other headers. Requests without a method override retain their original length.
Fixes #5520
Validation:
pnpm run test: 5,199 passed, 44 skipped, including TypeScript checks.NO_COLORwas unset for the color tests.pnpm run test:node: 14 passed.pnpm run test:bun: 16 passed.pnpm run build,pnpm run check:fix, andpnpm run editorconfig-checker: passed.The author should do the following, if applicable
pnpm run check:fixto format and lint the code