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 parse - failed #652

Closed
gendalf opened this issue Aug 27, 2012 · 1 comment
Closed

Cookie parse - failed #652

gendalf opened this issue Aug 27, 2012 · 1 comment

Comments

@gendalf
Copy link

gendalf commented Aug 27, 2012

After put node+connect in production 5% of request kill server... (multilanguage project)

CAUSE: Not always cookies is encoded with URIComponent, many requests have encoded cookies with escape
Patch lines in cookie/index.js

WAS:
obj[key] = decode(val)

My code for production:
try {
obj[key] = decode(val);
} catch(err) {
try {
obj[key] = unescape(val);
} catch(err){
console.log('FAIL DECODE COOKIE:', val);
}
}

@defunctzombie
Copy link
Contributor

Can you provide an example of a valid cookie which is not a valid URI or cannot be decoded?

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