DefaultCookieSerializer ignores null Cookie value

Previously a null Cookie value was returned by DefaultCookieSerializer
readCookieValues(). This could cause NullPointerExeptions later on.

This commit ignores cookies with a null value.

Fixes gh-392
This commit is contained in:
Rob Winch
2016-03-01 09:57:47 -06:00
parent 3300b58afe
commit 091d0d8d9f
2 changed files with 27 additions and 0 deletions

View File

@@ -59,6 +59,9 @@ public class DefaultCookieSerializer implements CookieSerializer {
for (Cookie cookie : cookies) {
if (cookieName.equals(cookie.getName())) {
String sessionId = cookie.getValue();
if(sessionId == null) {
continue;
}
if(jvmRoute != null && sessionId.endsWith(jvmRoute)) {
sessionId = sessionId.substring(0, sessionId.length() - jvmRoute.length());
}