Use the same name on the static variable for servlet compliance
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 23 Feb 2008 20:51:23 +0000 (20:51 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 23 Feb 2008 20:51:23 +0000 (20:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@630533 13f79535-47bb-0310-9956-ffa450edef68

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

index 75697b8..59dc717 100644 (file)
@@ -51,7 +51,12 @@ public class ServerCookie implements Serializable {
     private int maxAge = -1;
     private int version = 0;
 
-    protected static boolean switchToV1Cookies = !Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "false")).booleanValue();
+    /**
+     * If set to true, we parse cookies according to the servlet spec,
+     */
+    public static final boolean STRICT_SERVLET_COMPLIANCE =
+        Boolean.valueOf(System.getProperty("org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "false")).booleanValue();
+
 
     // Note: Servlet Spec =< 2.5 only refers to Netscape and RFC2109,
     // not RFC2965
@@ -340,7 +345,7 @@ public class ServerCookie implements Serializable {
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,1,value.length()-1));
             buf.append('"');
-        } else if (switchToV1Cookies && version==0 && !isToken2(value)) {
+        } else if ((!STRICT_SERVLET_COMPLIANCE) && version==0 && !isToken2(value)) {
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,0,value.length()));
             buf.append('"');