dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.71k stars 164 forks source link

Multiple `set-cookie` don't end up in the final response when an ALB is the trigger #276

Open rbhalla opened 1 year ago

rbhalla commented 1 year ago

I am using this library (v3.2.0) with an Express (4.17.1) app.

I have two routes. First route sets a single set-cookie. The second route sets multiple set-cookies.

I can confirm that the headers are there on the response by doing the following:

module.exports.handler = serverless(app, {
  response(response) {
    console.log(response)
    return response
  }
})

I have multiValueHeaders set in my serverless.yml file since I know that can be an issue here.

For some reason, in the actual response, I don't see any set-cookie headers on the second endpoint, only the first.

I have switched to serverless-express since that seems to work in my case, but thought I'd post an issue here in case it trips anyone else up.