Skip to content

Update Node.js version in GitHub Actions workflow to match workers-sdk#5867

Merged
anonrig merged 1 commit intomainfrom
pbd/workers-sdk/tests
Jan 12, 2026
Merged

Update Node.js version in GitHub Actions workflow to match workers-sdk#5867
anonrig merged 1 commit intomainfrom
pbd/workers-sdk/tests

Conversation

@petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Jan 12, 2026

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.

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.

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.
@petebacondarwin petebacondarwin requested review from a team as code owners January 12, 2026 20:25
@anonrig anonrig enabled auto-merge (squash) January 12, 2026 20:26
@anonrig anonrig merged commit b5c0267 into main Jan 12, 2026
20 checks passed
@anonrig anonrig deleted the pbd/workers-sdk/tests branch January 12, 2026 20:37
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 12, 2026

Merging this PR will degrade performance by 11.7%

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 137 untouched benchmarks
⏩ 38 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
simpleStringBody[Response] 19.2 µs 21.7 µs -11.7%
Encode_ASCII_256[TextEncoder][0/0/256] 3.5 ms 3.1 ms +12.61%
jsonResponse[Response] 42.5 µs 34.8 µs +22.28%

Comparing pbd/workers-sdk/tests (2f83973) with main (27e8141)

Open in CodSpeed

Footnotes

  1. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants