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

(cookies) TypeError: Cannot call method 'match' of undefined #1362

Closed
dominykas opened this issue Jan 27, 2014 · 0 comments
Closed

(cookies) TypeError: Cannot call method 'match' of undefined #1362

dominykas opened this issue Jan 27, 2014 · 0 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@dominykas
Copy link
Contributor

Took me a while to home in and I'm still not sure WHY it happens, but here's the problem: https://github.com/spumko/hapi/blob/master/lib/state.js#L68

Coupled with state.cookies.clearInvalid=true it results in request._clearState(undefined); which actually sets _state["undefined"] = { options: { ttl: 0 } }

Then, when the cookies get prepared for sending here: https://github.com/spumko/hapi/blob/master/lib/state.js#L320 name is undefined and naturally doesn't have a match() method.

I'm not even sure what is the expected behavior...

Update - the failing cookie:

__utmz=235668825.1384191435.1.1.utmcsr=bone.lt|utmccn=(referral)|utmcmd=referral|utmcct=/mano-bone/zinutes/,offset.300

It seems the comma in the cookie value throws things off - I'll be setting strictHeader=false, but the original problem of "undefined" becoming a cookie is still a bug.

@hueniverse hueniverse added this to the 2.2.0 milestone Feb 10, 2014
@hueniverse hueniverse self-assigned this Feb 10, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants