Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elastic Load Balancer reverses order of multiValueHeaders #244

Open
laverdet opened this issue Sep 30, 2022 · 0 comments
Open

Elastic Load Balancer reverses order of multiValueHeaders #244

laverdet opened this issue Sep 30, 2022 · 0 comments

Comments

@laverdet
Copy link

laverdet commented Sep 30, 2022

I noticed this issue and I'm not sure how long it's been around. I opened a similar issue at CodeGenieApp/serverless-express#554 since we use both of these packages. AWS Elastic Load Balancer is reversing the order of header values specified in multiValueHeaders. Is this something that you've seen before?

exports.handler = async (event) => ({
  statusCode: 200,
  body: JSON.stringify(event),
  isBase64Encoded: false,
  cookies: [
    'a=1',
    'a=2',
  ],
  multiValueHeaders: {
    'x-set-cookie': [
      'a=1',
      'a=2'
    ],
  },
  'content-type': [ 'text/plain' ],
});
-> % curl -vv http://lambd-LoadB-1DYPW4EWVLYCT-1230052677.us-east-1.elb.amazonaws.com 2>&1 | grep -i set-cookie
< x-set-cookie: a=2
< x-set-cookie: a=1

We can workaround it obviously but I'm wondering if this is a new issue or if ELB has always been broken, or if it's only broken in certain circumstances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant