tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r831782 - in /tomcat/trunk: java/org/apache/tomcat/util/http/ServerCookie.java webapps/docs/config/systemprops.xml
Date Sun, 01 Nov 2009 23:22:18 GMT
Author: markt
Date: Sun Nov  1 23:22:18 2009
New Revision: 831782

URL: http://svn.apache.org/viewvc?rev=831782&view=rev
Log:
As per Remy's feedback, auto-switching cookie version is OK and we should also do it if a
comment is specified

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java
    tomcat/trunk/webapps/docs/config/systemprops.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java?rev=831782&r1=831781&r2=831782&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/ServerCookie.java Sun Nov  1 23:22:18 2009
@@ -75,14 +75,6 @@
     public static final boolean STRICT_SERVLET_COMPLIANCE;
 
     /**
-     * If set to false, we don't auto switch invalid v0 cookies to v1 and add
-     * quotes to make them valid.
-     * Default is usually true. If STRICT_SERVLET_COMPLIANCE==true then default
-     * is false. Explicitly setting always takes priority.
-     */
-    public static final boolean ALLOW_VERSION_SWITCH;
-
-    /**
      * If set to false, we don't use the IE6/7 Max-Age/Expires work around.
      * Default is usually true. If STRICT_SERVLET_COMPLIANCE==true then default
      * is false. Explicitly setting always takes priority.
@@ -105,15 +97,6 @@
                 "false")).booleanValue();
         
 
-        String allowVersionSwitch = System.getProperty(
-                "org.apache.tomcat.util.http.ServerCookie.ALLOW_VERSION_SWITCH");
-        if (allowVersionSwitch == null) {
-            ALLOW_VERSION_SWITCH = !STRICT_SERVLET_COMPLIANCE;
-        } else {
-            ALLOW_VERSION_SWITCH =
-                Boolean.valueOf(allowVersionSwitch).booleanValue();
-        }
-
         String alwaysAddExpires = System.getProperty(
                 "org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES");
         if (alwaysAddExpires == null) {
@@ -319,6 +302,11 @@
         // Servlet implementation does not check anything else
         
         version = maybeQuote2(version, buf, value,true);
+        
+        // Spec team clarified setting comment on a v0 cookie switches it to v1
+        if (version == 0 && comment != null) {
+            version = 1;
+        }
 
         // Add version 1 specific information
         if (version == 1) {
@@ -417,7 +405,7 @@
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,1,value.length()-1));
             buf.append('"');
-        } else if (allowVersionSwitch && ALLOW_VERSION_SWITCH && version==0
&& !isToken2(value, literals)) {
+        } else if (allowVersionSwitch && version==0 && !isToken2(value, literals))
{
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,0,value.length()));
             buf.append('"');

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=831782&r1=831781&r2=831782&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Nov  1 23:22:18 2009
@@ -241,7 +241,6 @@
       </li>
       <li>
         The default value will be changed for
-        <code>org.apache.tomcat.util.http.ServerCookie.ALLOW_VERSION_SWITCH</code>.
         <code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.
         <code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.
         <code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.
@@ -278,16 +277,6 @@
     </property>
 
     <property
-    name="org.apache.tomcat.util.http. ServerCookie.ALLOW_VERSION_SWITCH">
-      <p>If this is <code>true</code> Tomcat will convert a v0 cookie that
-      contains invalid characters (i.e. separators) to a v1 cookie and add
-      quotes as required. If not specified, the default value will be used. If
-      <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> is set to
-      <code>true</code>, the default of this setting will be <code>false</code>,
-      else the default value will be <code>true</code>.</p>
-    </property>
-
-    <property
     name="org.apache.tomcat.util.http. ServerCookie.ALWAYS_ADD_EXPIRES">
       <p>If this is <code>true</code> Tomcat will always add an expires
       parameter to a SetCookie header even for cookies with version greater than



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message