Update Node.js version in GitHub Actions workflow to match workers-sdk#5867
Merged
Update Node.js version in GitHub Actions workflow to match workers-sdk#5867
Conversation
There was a subtle change in how `FormData` is serialized between Node 20.19.1 and 20.19.6, which makes the snapshot tests change. After 20.19.6, there is an additional empty line at the end of FormData in snapshots. Updating to this version aligns with workers-sdk.
anonrig approved these changes Jan 12, 2026
Merging this PR will degrade performance by 11.7%
Performance Changes
Comparing Footnotes
|
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.
There was a subtle change in how
FormDatais serialized between Node 20.19.1 and 20.19.6, which makes the snapshot tests change.After 20.19.6, there is an additional empty line at the end of FormData in snapshots. Updating to this version aligns with workers-sdk.
Here is the PR in Undici where this changed: nodejs/undici#3625
From Gemini:
There was a specific change regarding trailing whitespace (CRLF) in FormData serialization between Undici v6.21.2 and v6.22.0.
This change fixes a bug where the final boundary of a multipart/form-data payload was malformed, causing compatibility issues with certain strict servers.
The Change: Missing CRLF
In v6.21.2 (and earlier): The FormData serializer omitted the final \r\n (Carriage Return + Line Feed) after the last boundary.
In v6.22.0: The serializer was updated to explicitly append this trailing \r\n to comply with stricter interpretations of the multipart spec.
Why this matters
While many servers are lenient and accept the body without the final newline, strict HTTP parsers (often found in older enterprise backends, Java/Spring servers, or specific WAFs) expect the body to end with a newline.