Repository navigation
Conversation
The "POST with base64 encoding" test started failing with a 500 because an assertion inside the route handler threw. The base64 body handling is fine: the failing assertion was on the `x-multi` header built from the event's `multiValueHeaders`. This library passes multi-value headers to `app.inject()` as an array. light-my-request used to coerce such arrays with `'' + value`, producing `'just-the-first,and-the-second'`. Since light-my-request 6.8.0 (fastify/light-my-request#388, published 2026-10-10 and picked up by CI once it passed the 7 day min-release-age) array header values are aggregated the same way Node's HTTP server combines repeated header lines, joined with ', ', so the handler now receives 'just-the-first, and-the-second'. That is the correct behaviour for a header sent multiple times, so update the test expectation instead of changing the library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sfj4nEK6BT2fQMtaQ22BnF
adrai
approved these changes
Dec 2, 2026
This branch has not been deployed
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.
Root cause
test/basic.test.js›POST with base64 encodinghas been failing on every CI run since mid-October (500 == 200attest/basic.test.js:466), on all Node versions and OSes. The 500 does not come from the base64 body handling. It comes from anassertinside the route handler that throws and is turned into a 500 by Fastify's default error handler. The assertion that throws is on thex-multiheader, which the test builds from the event'smultiValueHeaders:This library passes multi-value headers to
app.inject()as an array. light-my-request used to stringify array header values with'' + value, which joins them with a bare,. Since light-my-request 6.8.0 (fastify/light-my-request#388, commit fastify/light-my-request@627c890, release notes), array header values are aggregated the same way Node's HTTP server combines repeated header lines:', 'for most headers,'; 'forcookie, an array forset-cookie, and first-value-wins for single-value headers.6.8.0 was published on 2026-10-10. Because
.npmrcsetspackage-lock=falseandmin-release-age=7, CI started installing it around 2026-10-17. That is after the last green run onmain(2026-10-05). fastify 5 depends onlight-my-request@^6.0.0, so every install now gets the new behaviour.Fix
Update the test expectation to
'just-the-first, and-the-second'. The handler now sees what a real Node HTTP server would expose for a header sent twice, so the library code needs no change. Nothing else in the suite depends on the old joining.Verification
npm install --ignore-scripts(fastify 5.12.8, light-my-request 6.8.1):node --test --test-name-pattern='POST with base64 encoding' test/basic.test.jsfailed with500 == 200. Logging the request inside the handler showedx-multi: 'just-the-first, and-the-second'.npm run lint: cleannpm test: unit tests 39/39 passed; tstyche 18/18 assertions passedThis unblocks CI for the open PRs #322 and #323, which only touch workflows and fail on this test.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Sfj4nEK6BT2fQMtaQ22BnF