Skip to content

fix(event-handler): preserve response and streaming cookies - #5845

Open
dreamorosi wants to merge 1 commit into
mainfrom
fix/http-cookie-loss
Open

dreamorosi wants to merge 1 commit into
mainfrom
fix/http-cookie-loss

Conversation

@dreamorosi

Copy link
Copy Markdown
Contributor

Summary

Preserve every cookie when merging returned Web Responses with middleware headers and when writing streaming response metadata.

This fixes the cookie-loss defects split from #5674. Buffered comma splitting, ALB header-mode selection, and response-shape changes remain in the parent issue for the next major version.

Changes

  • Append returned Response cookies instead of overwriting earlier cookies, while preserving replacement behavior for non-cookie headers.
  • Include cookies separately in streaming metadata for both incoming payload versions, without splitting comma-containing values.
  • Add regression tests for handler and middleware cookies, header precedence, and streaming metadata.
  • Document cookie handling for returned Responses and streaming responses.

Issue number: closes #5844


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.

Append Response cookies during header merging and include every cookie in streaming metadata.

Keep buffered header conversion and ALB response-shape changes outside this fix.

Fixes #5844

Refs #5674
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/L PRs between 100-499 LOC label Oct 25, 2026
@dreamorosi
dreamorosi requested a review from svozza October 25, 2026 16:55
@dreamorosi
dreamorosi marked this pull request as ready for review October 25, 2026 16:55

This branch has not been deployed

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

Labels

size/L PRs between 100-499 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: HTTP event handler drops cookies from Responses and streaming metadata

1 participant