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

if the Cookie contain version='' ,can't get the request.cookies #290

Closed
wilhelmguo opened this Issue Dec 30, 2015 · 1 comment

Comments

3 participants
@wilhelmguo

wilhelmguo commented Dec 30, 2015

If customer‘s Cookie contain version='',the com.twitter.finagle.http.Message.cookies will be null.
Cause the reason is the netty-3.10.1.Final.jar
class:org.jboss.netty.handler.codec.http.CookieDecoder
method:decode
exception code:
if (names.get(0).equalsIgnoreCase(CookieHeaderNames.VERSION)) { //that will be exception when version is ''
try {
version = Integer.parseInt(values.get(0));
} catch (NumberFormatException e) {
// Ignore.
}
i = 1;
}

and line 139
else if (CookieHeaderNames.VERSION.equalsIgnoreCase(name)) {
version = Integer.parseInt(value);
}
Call the class in finagle-http_2.11-6.25.0.jar com.twitter.finagle.http.CookieMap.class:
private[this] def decodeCookies(header: String): Iterable[Cookie] = {
val decoder = new NettyCookieDecoder
try {
decoder.decode(header).asScala map { new Cookie(_) }
} catch {
case e: IllegalArgumentException =>
_isValid = false
Nil
}
}

@taylorleese

This comment has been minimized.

Member

taylorleese commented Jan 3, 2016

See comments in twitter/finagle#453.

@cacoco cacoco closed this Jan 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment