Skip to content

fix(aws-lambda): omit headers whose value is an empty array - #130

Merged
dinwwwh merged 1 commit into
mainfrom
claude/lambda-empty-header-fix-bde98b
Sep 29, 2026
Merged

dinwwwh merged 1 commit into
mainfrom
claude/lambda-empty-header-fix-bde98b

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Sep 29, 2026

Copy link
Copy Markdown
Member

The aws-lambda adapter no longer sends a header whose value is [] as an empty header (x-foo: ""). toLambdaHeaders joined array values with ', ', and [].join(', ') is ''. Now an empty array means the header is left out, as the fetch adapter already does.

Fixes

  • A response header set to [] is now omitted from the Lambda response metadata. It used to be sent with an empty value.
  • A header set explicitly to '' is still sent as an empty header.

Testing

  • The toLambdaHeaders test now covers [] and '' values. The [] case fails against main.
  • vitest run packages/aws-lambda (100 passed), eslint and tsc are clean.

🤖 Generated with Claude Code

`toLambdaHeaders` joined array values with `', '`, so a header set to `[]`
was sent as an empty header instead of being left out. It is now skipped,
matching the fetch adapter. An explicit `''` string is still sent.

Co-Authored-By: Claude <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 29, 2026

Copy link
Copy Markdown
@standard-server/aws-lambda

npm i https://pkg.pr.new/@standard-server/aws-lambda@130

@standard-server/core

npm i https://pkg.pr.new/@standard-server/core@130

@standard-server/fastify

npm i https://pkg.pr.new/@standard-server/fastify@130

@standard-server/fetch

npm i https://pkg.pr.new/@standard-server/fetch@130

@standard-server/node

npm i https://pkg.pr.new/@standard-server/node@130

@standard-server/peer

npm i https://pkg.pr.new/@standard-server/peer@130

@standard-server/shared

npm i https://pkg.pr.new/@standard-server/shared@130

commit: c7d62c5

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Omit empty-array headers in the Lambda adapter — toLambdaHeaders now skips a header whose value is [] instead of serializing it as x-foo: ""; an explicitly empty string is still sent.
  • Test coverage — the toLambdaHeaders case adds 'x-empty': [] (asserted omitted) and 'x-empty-string': '' (asserted kept), so the new branch is pinned and the [] assertion fails against main.

The guard matches the fetch adapter's behavior (toFetchHeaders appends nothing for an empty array), and the set-cookie branch is unaffected since [] already contributed no cookies. The change is minimal and well-covered.

Pullfrog  | View workflow run | Using DeepSeek Flash (default — pick a model for stronger reviews) | 𝕏

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 108 skipped benchmarks1


Comparing claude/lambda-empty-header-fix-bde98b (c7d62c5) with main (7d2294c)

Open in CodSpeed

Footnotes

  1. 108 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. ↩

@dinwwwh
dinwwwh merged commit 325e1b0 into main Sep 29, 2026
11 checks passed
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.

1 participant