Author: jfrederic.clere(a)jboss.com
Date: 2011-02-09 10:01:34 -0500 (Wed, 09 Feb 2011)
New Revision: 1650
Modified:
branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
Log:
Fix for JBWEB-196 (Fix for JBPAPP-2039.)
Modified: branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2011-02-09 13:42:49 UTC
(rev 1649)
+++ branches/2.1.x/java/org/apache/tomcat/util/http/Cookies.java 2011-02-09 15:01:34 UTC
(rev 1650)
@@ -60,14 +60,22 @@
'\t':9 ' ':32 '\"':34 '(':40 ')':41
',':44 ':':58 ';':59 '<':60
'=':61 '>':62 '?':63 '@':64 '[':91
'\\':92 ']':93 '{':123 '}':125
*/
- public static final char SEPARATORS[] = { '\t', ' ',
'\"', '(', ')', ',',
- ':', ';', '<', '=', '>',
'?', '@', '[', '\\', ']', '{', '}'
};
+ public static final char SEPARATORS[];
protected static final boolean separators[] = new boolean[128];
static {
for (int i = 0; i < 128; i++) {
separators[i] = false;
}
+ if
(Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH",
"false")).booleanValue()) {
+ /* Version 1 separators */
+ SEPARATORS = new char[] { '\t', ' ', '\"',
'\'', '(', ')', ',',
+ ':', ';', '<', '=', '>',
'?', '@', '[', '\\', ']', '{', '}'
};
+ } else {
+ /* Version 0 separators */
+ SEPARATORS = new char[] { ',', ';', ' ',
'\t', '='};
+ }
+
for (int i = 0; i < SEPARATORS.length; i++) {
separators[SEPARATORS[i]] = true;
}