Cookie parse - failed #652

gendalf opened this Issue Aug 27, 2012 · 1 comment

3 participants


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

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 defunctzombie referenced this issue in jshttp/cookie Sep 23, 2012

Error when decoding URI component #5


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