awslabs / aws-lambda-go-api-proxy

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Apache License 2.0
1.03k stars 198 forks source link

Cookies don't seem to be getting mapped with api gateway v2 #108

Open ThomasJamesCrawford opened 2 years ago

ThomasJamesCrawford commented 2 years ago

It seems like api gateway v2 is removing the cookie header and placing them into req.Cookies

But this isn't taken into account in the mapping awslabs/aws-lambda-go-api-proxy/core/requestv2.go

As a result in my code I'm having to add the cookies back into the headers first

req.Headers["cookie"] = strings.Join(req.Cookies, ",")

aubelsb2 commented 2 years ago

I found the cause of this I addressed it in this pr: https://github.com/awslabs/aws-lambda-go-api-proxy/pull/109

But I have included probably too many changes for it to be accepted.

AlexLast commented 2 years ago

@aubelsb2 @ThomasJamesCrawford Also just hit this issue.. so thanks for raising. Since the existing PR hasn't seen any traction, I've raised a separate PR scoped to just supporting cookies for V2 requests - hopefully will have more luck with this 🤞

aubelsb2 commented 2 years ago

Anyone with a premium account want to try raise a support issue to get this seen to?

sapessi commented 2 years ago

I merged the original PR. I will tag a new minor version shortly

AlexLast commented 2 years ago

Awesome, thanks - will close mine