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

Possible issues with Cookies #73

Open
H4ad opened this issue Dec 20, 2022 · 5 comments
Open

Possible issues with Cookies #73

H4ad opened this issue Dec 20, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@H4ad
Copy link
Owner

H4ad commented Dec 20, 2022

Hi @laverdet and @ml27299,

Sorry to tag you both, but I saw you both creating issues on vendia-serverless: CodeGenieApp/serverless-express#609 and CodeGenieApp/serverless-express#554.

My library has the same intention of vendia/serverless-express but I construct it be more extensible and easier to maintain and customize than vendia.

Because my library is a refactored version of vendia/serverless-express, maybe it could have some issues that you both describe in the issues above.

I'm proposing that you try my library and let me know if the problems with cookies will persist, if so, I can work on trying to fix these problems.
If so, I'll have more description and also someone to test with because I currently don't have APIs that use ALB or cookies, so it's hard for me to test those scenarios.

For ALB, I have two problems to fix from what I saw from your issues:

@H4ad H4ad added the bug Something isn't working label Dec 20, 2022
@H4ad H4ad self-assigned this Dec 20, 2022
@H4ad
Copy link
Owner Author

H4ad commented Dec 20, 2022

About the problem with ALB stringify headers, I already added PR to fix this issue at #74.

@laverdet
Copy link

I won't be able to test your package but you should also take a look at CodeGenieApp/serverless-express#554 which has some information on broken header ordering under AWS ELB. Under this environment [when event.version === undefined] you need to reverse the order of multiValueHeaders in order to send back headers in the correct order. This has ramifications, for example, when your response deletes a cookie and then sets a new value on that same cookie. Without this workaround an application which works correctly on ALB will fail in strange ways under ELB. Included in the issue is a CloudFormation template and shell script which demonstrates the problem clearly.

Also if I remember correctly the StackOverflow answer, while certainly clever, doesn't help that much. Under ELB it does let you set multiple headers when lambda.multi_value_headers.enabled is false, but it should be preferred to always enable this option and use multiValueHeaders instead.

@H4ad
Copy link
Owner Author

H4ad commented Dec 20, 2022

Thanks for your time, I will look carefully to see which things I can improve based on that issue.
You already give a lot of information, I will try to run CloudFormation to reproduce the same problem.

@ml27299
Copy link

ml27299 commented Dec 21, 2022

Thanks for the quick update! In my case turning on the multi-value headers via alb worked

@laverdet
Copy link

The issue is with ELB not ALB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants