You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/05/10 09:06:39 UTC

svn commit: r1743134 - in /tomcat/trunk: java/org/apache/tomcat/util/http/LegacyCookieProcessor.java test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java webapps/docs/changelog.xml

Author: markt
Date: Tue May 10 09:06:39 2016
New Revision: 1743134

URL: http://svn.apache.org/viewvc?rev=1743134&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59450
Correctly handle the case where the LegacyCookieProcessor is configured with allowHttpSepsInV0 set to false and forwardSlashIsSeparator set to true.
Patch provided by Kyohei Nakamura.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java
    tomcat/trunk/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java?rev=1743134&r1=1743133&r2=1743134&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java Tue May 10 09:06:39 2016
@@ -179,9 +179,9 @@ public final class LegacyCookieProcessor
             }
         }
         if (getForwardSlashIsSeparator() && !allowHttpSepsInV0) {
-            allowedWithoutQuotes.set('/');
-        } else {
             allowedWithoutQuotes.clear('/');
+        } else {
+            allowedWithoutQuotes.set('/');
         }
     }
 
@@ -198,9 +198,9 @@ public final class LegacyCookieProcessor
             httpSeparatorFlags.clear('/');
         }
         if (forwardSlashIsSeparator && !getAllowHttpSepsInV0()) {
-            allowedWithoutQuotes.set('/');
-        } else {
             allowedWithoutQuotes.clear('/');
+        } else {
+            allowedWithoutQuotes.set('/');
         }
     }
 

Modified: tomcat/trunk/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java?rev=1743134&r1=1743133&r2=1743134&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java Tue May 10 09:06:39 2016
@@ -69,8 +69,9 @@ public class TestCookieProcessorGenerati
 
     @Test
     public void v0ValueContainsNonV0Separator() {
-        doTest(new Cookie("foo", "a()<>@:\\\"/[]?={}b"),
-                "foo=\"a()<>@:\\\\\\\"/[]?={}b\"; Version=1", null);
+        Cookie cookie = new Cookie("foo", "a()<>@:\\\"/[]?={}b");
+        doTestDefaults(cookie,"foo=\"a()<>@:\\\\\\\"/[]?={}b\"; Version=1", null);
+        doTestAllowSeparators(cookie,"foo=a()<>@:\\\"/[]?={}b", null);
     }
 
     @Test

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1743134&r1=1743133&r2=1743134&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue May 10 09:06:39 2016
@@ -287,6 +287,13 @@
         <bug>59451</bug>: Correct Javadoc for <code>MessageBytes</code>. Patch
         provided by Kyohei Nakamura. (markt)
       </fix>
+      <fix>
+        <bug>59450</bug>: Correctly handle the case where the
+        <code>LegacyCookieProcessor</code> is configured with
+        <code>allowHttpSepsInV0</code> set to <code>false</code> and
+        <code>forwardSlashIsSeparator</code> set to <code>true</code>. Patch
+        provided by Kyohei Nakamura. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">



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