Better handle edge cases when allowing = in cookie value
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Nov 2009 20:49:04 +0000 (20:49 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 17 Nov 2009 20:49:04 +0000 (20:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@881500 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/http/Cookies.java

index 7249cb0..bb663ce 100644 (file)
@@ -323,7 +323,8 @@ public final class Cookies { // extends MultiMap {
                     if (version == 0 &&
                                 !CookieSupport.isV0Separator((char)bytes[pos]) &&
                                 CookieSupport.ALLOW_HTTP_SEPARATORS_IN_V0 ||
-                            !CookieSupport.isHttpSeparator((char)bytes[pos])) {
+                            !CookieSupport.isHttpSeparator((char)bytes[pos]) ||
+                            bytes[pos] == '=' && CookieSupport.ALLOW_EQUALS_IN_VALUE) {
                         // Token
                         valueStart=pos;
                         // getToken returns the position at the delimeter