Skip to content

fix(event-handler): handle set-cookie header values with multiple attributes#4990

Merged
svozza merged 6 commits intoaws-powertools:mainfrom
nateiler:event-handler-set-cookie
Feb 10, 2026
Merged

fix(event-handler): handle set-cookie header values with multiple attributes#4990
svozza merged 6 commits intoaws-powertools:mainfrom
nateiler:event-handler-set-cookie

Conversation

@nateiler
Copy link
Contributor

@nateiler nateiler commented Feb 4, 2026

Summary

This fixes the scenario where a single set-cookie header value foo=bar; Max-Age=3600 is treated as two set-cookie values because multiple values may be separated by a ;.

Changes

When parsing the headers, set-cookie headers are handled using the getSetCookie method.

Logic to detect multiple header entries has been removed as multiple header values are appended to a single header (via comma).

Issue number: closes #4986


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Feb 4, 2026
@boring-cyborg boring-cyborg bot added event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Feb 4, 2026
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 4, 2026

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @nateiler - appreciate it.

I have left a couple comments on the diff, would like to also get @svozza's review on the PR before we merge/

@dreamorosi dreamorosi requested a review from svozza February 5, 2026 08:56
@dreamorosi dreamorosi dismissed their stale review February 6, 2026 09:55

My comments were addressed, will leave to @svozza to bring the PR to merge state.

@svozza
Copy link
Contributor

svozza commented Feb 10, 2026

Thank you @nateiler for your work on this. Approved.

@sonarqubecloud
Copy link

@svozza svozza merged commit 42317fe into aws-powertools:main Feb 10, 2026
46 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 10, 2026

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

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

Labels

event-handler This item relates to the Event Handler Utility size/L PRs between 100-499 LOC tests PRs that add or change tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Event Handler Response Headers incorrectly handling Set-Cookie values

3 participants