Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.53 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/java/org/apache/tomcat/util/http/Cookies.java b/java/org/apache/tomcat/util/http/Cookies.java
  2. index fda0adf..77a673b 100644
  3. --- a/java/org/apache/tomcat/util/http/Cookies.java
  4. +++ b/java/org/apache/tomcat/util/http/Cookies.java
  5. @@ -51,7 +51,8 @@ public final class Cookies { // extends MultiMap {
  6.       * being quoted.
  7.       */
  8.      public static final boolean ALLOW_EQUALS_IN_VALUE;
  9. -    
  10. +
  11. +    public static final boolean ALLOW_SPECIAL_CHARS_IN_VALUE;
  12.      /*
  13.      List of Separator Characters (see isSeparator())
  14.      Excluding the '/' char violates the RFC, but
  15. @@ -75,6 +76,9 @@ public final class Cookies { // extends MultiMap {
  16.          ALLOW_EQUALS_IN_VALUE = Boolean.valueOf(System.getProperty(
  17.                  "org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE",
  18.                  "false")).booleanValue();
  19. +        ALLOW_SPECIAL_CHARS_IN_VALUE = Boolean.valueOf(System.getProperty(
  20. +                "org.forgerock.tomcat.util.http.ServerCookie.ALLOW_SPECIAL_CHARS_IN_VALUE",
  21. +                "false")).booleanValue();
  22.      }
  23.  
  24.      /**
  25. @@ -580,7 +584,9 @@ public final class Cookies { // extends MultiMap {
  26.          int pos = off;
  27.          while (pos < end &&
  28.                  (!isSeparator(bytes[pos]) ||
  29. -                 bytes[pos]=='=' && ALLOW_EQUALS_IN_VALUE && !isName)) {
  30. +                 (((ALLOW_EQUALS_IN_VALUE && bytes[pos]=='=')
  31. +                 || (ALLOW_SPECIAL_CHARS_IN_VALUE && bytes[pos]=='@'))
  32. +                 && !isName))) {
  33.              pos++;
  34.          }