fix(lambdaurl): proxy Cookies slice to http.Request header in Wrap#622
Open
mangomaker5 wants to merge 1 commit intoaws:mainfrom
Open
fix(lambdaurl): proxy Cookies slice to http.Request header in Wrap#622mangomaker5 wants to merge 1 commit intoaws:mainfrom
mangomaker5 wants to merge 1 commit intoaws:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #622 +/- ##
==========================================
- Coverage 75.12% 75.08% -0.04%
==========================================
Files 36 36
Lines 1419 1425 +6
==========================================
+ Hits 1066 1070 +4
- Misses 274 275 +1
- Partials 79 80 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Fixes #597
The
Wrapfunction inlambdaurlconverts aLambdaFunctionURLRequestinto a standard Gohttp.Request. Currently, it only proxies cookies found inHeaders["cookie"]and completely ignores the dedicatedCookiesfield on the request struct.This breaks use cases where stream handlers rely on
r.Cookies()and AWS populates theCookiesslice instead of (or in addition to) thecookieheader.Changes
Added logic to proxy
request.Cookiesentries into thehttp.Requestheader, with a guard to prevent duplicate cookie headers when bothHeaders["cookie"]andCookiesare populated by AWS:This follows the same pattern used by aws-lambda-go-api-proxy, as referenced in the original issue.
Testing
go test -race ./lambdaurl/...)function-url-request-with-headers-and-cookies-and-text-body.jsoncontains bothHeaders["cookie"]andCookies— thehasCookieguard ensures no duplication in this caseNotes
This issue has been open since October 2025 with no maintainer response or linked PRs. Since the fix is minimal (9 lines added, 0 lines removed from logic) and all existing tests pass, I've submitted this to move the conversation forward.