-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Invalid cookie value - cookie has spaces #2996
Comments
Did you try turning strict cookie parsing off? |
Are you talking about disabling parsing for cookies altogether, or is there one specifically to parse it still, just not in a "strict" way ? The latter I can't find |
I tried this before asking, but looks like I had missed one cookie name. 😓 |
Oh, and thanks |
This came up again in a different context. I tried using The only thing that worked is setting the config to option to I looked at https://github.com/hapijs/hapi/blob/master/lib/connection.js#L78 but it looks like the server.state has an impact here per cookie. What am I missing this time? Is it just not possible to configure per cookie? |
How is the cookie invalid? |
const headers = {
Cookie: 'SESSIONID=4/7/2016 18:31:45 PM'
};
server.inject({ method: 'GET', url: url, headers: headers }, (res) => { this will cause the error. removing the spaces causes it to work |
Can you PR a test case showing how setting a single cookie config fails? |
going to close this either way |
rather than setting parse:false I have worked around this by setting
|
I just want to explain why @carraher's solution above worked for me. I'm using the |
ref #2513
I came across the issue above with a website I'm migrating that has improperly escaped cookies with spaces in them. When trying to access a hapi server with those cookies, hapi fails with the error
Because it's using legacy code, the cookies are stored on the user client.
Thoughts on how to handle this?
The text was updated successfully, but these errors were encountered: