From 53f3f37eaa0fe9adc7312835ec182cede33b6d22 Mon Sep 17 00:00:00 2001 From: MangoMaker Date: Fri, 27 Mar 2026 15:20:20 +0530 Subject: [PATCH] fix(lambdaurl): proxy Cookies slice to http.Request header in Wrap (#597) --- lambdaurl/http_handler.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lambdaurl/http_handler.go b/lambdaurl/http_handler.go index c4cb807a..9f2cc030 100644 --- a/lambdaurl/http_handler.go +++ b/lambdaurl/http_handler.go @@ -119,8 +119,17 @@ func Wrap(handler http.Handler) func(context.Context, *events.LambdaFunctionURLR return nil, err } httpRequest.RemoteAddr = request.RequestContext.HTTP.SourceIP + hasCookie := false for k, v := range request.Headers { httpRequest.Header.Add(k, v) + if strings.ToLower(k) == "cookie" { + hasCookie = true + } + } + if !hasCookie { + for _, cookie := range request.Cookies { + httpRequest.Header.Add("Cookie", cookie) + } } ready := make(chan header) // Signals when it's OK to start returning the response body to Lambda