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

cookie parsing is poor emulation of lambda #385

Closed
wheresrhys opened this issue Apr 4, 2018 · 2 comments
Closed

cookie parsing is poor emulation of lambda #385

wheresrhys opened this issue Apr 4, 2018 · 2 comments

Comments

@wheresrhys
Copy link

By default hapi parses cookies, but the parser can error on strange cookie values (see hapijs/hapi#2513 for the issue, example bad cookie value: {"eid":12345%2C"email":""%2C"hash":"abcde"%2C"level":"premium"%2C"name":"a%20Premium%20user"%2C"passportid":abcd1234%2C"username":"A%20user"%2C"uuid":"00000000-0000-0000-0000-00000000"%2C"signature":"1234\%2Fabcd\%2abcd="%2C"key":"v1"%2C"refreshed":1522855575})

The above cookie causes a {"statusCode":400,"error":"Bad Request","message":"Invalid cookie value"} response locally using serverless offline, but no such problem in production.

Would setting parse: false in the HAPI options used by serverless-offline provide better emulation of production lambda?

@scaret
Copy link

scaret commented Apr 22, 2018

I solved this by visiting direct IP address in browser (i.e. 127.0.0.1 instead of localhost)

@sebastiangug
Copy link

@scaret this solution is poor because then you run into all sorts of issues when trying to use SSL in development which you can't sign for IP addresses, only for domains. Then you can't use secure cookies for sessions and you're SOL.

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

3 participants