Author: fhanik
Date: Fri Mar 21 16:29:17 2008
New Revision: 639909

URL: http://svn.apache.org/viewvc?rev=639909&view=rev
Log:
only make version switch on cookie value

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/ServerCookie.java

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=639909&r1=639908&r2=639909&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Fri Mar 21 16:29:17 2008
@@ -55,24 +55,6 @@
   +0: remm: do we really want to fix these sort of "bugs" ?
   -1:
 
-* Cookie completion. Only do the autoswitch on the value of the cookie, quote 
domain/path same way as we did before
-258c258
-<         version = maybeQuote2(version, buf, value);
----
->         version = maybeQuote2(version, buf, value,true);
-339a340,343
->         return maybeQuote2(version,buf,value,false);
->     }
->
->     public static int maybeQuote2 (int version, StringBuffer buf, String 
value, boolean allowVersionSwitch) {
-348c352
-<         } else if ((!STRICT_SERVLET_COMPLIANCE) && version==0 && 
!isToken2(value)) {
----
->         } else if (allowVersionSwitch && (!STRICT_SERVLET_COMPLIANCE) && 
version==0 && !isToken2(value)) {
-
-   +1: fhanik, markt, remm
-   -1: 
-
 * Remove reference to admin application
   http://svn.apache.org/viewvc?rev=639198&view=rev
   +1: markt, remm

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/ServerCookie.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/ServerCookie.java?rev=639909&r1=639908&r2=639909&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/ServerCookie.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/http/ServerCookie.java Fri 
Mar 21 16:29:17 2008
@@ -255,7 +255,7 @@
         buf.append("=");
         // Servlet implementation does not check anything else
         
-        version = maybeQuote2(version, buf, value);
+        version = maybeQuote2(version, buf, value,true);
 
         // Add version 1 specific information
         if (version == 1) {
@@ -337,6 +337,10 @@
      * @param value
      */
     public static int maybeQuote2 (int version, StringBuffer buf, String 
value) {
+        return maybeQuote2(version,buf,value,false);
+    }
+
+    public static int maybeQuote2 (int version, StringBuffer buf, String 
value, boolean allowVersionSwitch) {
         if (value==null || value.length()==0) {
             buf.append("\"\"");
         }else if (containsCTL(value,version)) 
@@ -345,7 +349,7 @@
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,1,value.length()-1));
             buf.append('"');
-        } else if ((!STRICT_SERVLET_COMPLIANCE) && version==0 && 
!isToken2(value)) {
+        } else if (allowVersionSwitch && (!STRICT_SERVLET_COMPLIANCE) && 
version==0 && !isToken2(value)) {
             buf.append('"');
             buf.append(escapeDoubleQuotes(value,0,value.length()));
             buf.append('"');



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to