ASF Bugzilla – Attachment 22180 Details for
Bug 45272
Version 1 cookie not persisted in IE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for IE cookie behavior
patch.txt (text/plain), 3.24 KB, created by
Filip Hanik
on 2008-06-26 11:26:26 UTC
(
hide
)
Description:
Patch for IE cookie behavior
Filename:
MIME Type:
Creator:
Filip Hanik
Created:
2008-06-26 11:26:26 UTC
Size:
3.24 KB
patch
obsolete
>Index: java/org/apache/tomcat/util/http/ServerCookie.java >=================================================================== >--- java/org/apache/tomcat/util/http/ServerCookie.java (revision 671643) >+++ java/org/apache/tomcat/util/http/ServerCookie.java (working copy) >@@ -135,6 +135,7 @@ > > private static final String tspecials = ",; "; > private static final String tspecials2 = "()<>@,;:\\\"/[]?={} \t"; >+ private static final String tspecials2NoSlash = "()<>@,;:\\\"[]?={} \t"; > > /* > * Tests a string and returns true if the string counts as a >@@ -146,6 +147,11 @@ > * token; <code>false</code> if it is not > */ > public static boolean isToken(String value) { >+ return isToken(value,null); >+ } >+ >+ public static boolean isToken(String value, String literals) { >+ String tspecials = (literals==null?ServerCookie.tspecials:literals); > if( value==null) return true; > int len = value.length(); > >@@ -172,8 +178,12 @@ > return false; > } > >+ public static boolean isToken2(String value) { >+ return isToken2(value,null); >+ } > >- public static boolean isToken2(String value) { >+ public static boolean isToken2(String value, String literals) { >+ String tspecials2 = (literals==null?ServerCookie.tspecials2:literals); > if( value==null) return true; > int len = value.length(); > >@@ -299,7 +309,11 @@ > // Path=path > if (path!=null) { > buf.append ("; Path="); >- maybeQuote2(version, buf, path); >+ if (version==0) { >+ maybeQuote2(version, buf, path); >+ } else { >+ maybeQuote2(version, buf, path, ServerCookie.tspecials2NoSlash, false); >+ } > } > > // Secure >@@ -341,6 +355,10 @@ > } > > public static int maybeQuote2 (int version, StringBuffer buf, String value, boolean allowVersionSwitch) { >+ return maybeQuote2(version,buf,value,null,allowVersionSwitch); >+ } >+ >+ public static int maybeQuote2 (int version, StringBuffer buf, String value, String literals, boolean allowVersionSwitch) { > if (value==null || value.length()==0) { > buf.append("\"\""); > }else if (containsCTL(value,version)) >@@ -349,16 +367,16 @@ > buf.append('"'); > buf.append(escapeDoubleQuotes(value,1,value.length()-1)); > buf.append('"'); >- } else if (allowVersionSwitch && (!STRICT_SERVLET_COMPLIANCE) && version==0 && !isToken2(value)) { >+ } else if (allowVersionSwitch && (!STRICT_SERVLET_COMPLIANCE) && version==0 && !isToken2(value, literals)) { > buf.append('"'); > buf.append(escapeDoubleQuotes(value,0,value.length())); > buf.append('"'); > version = 1; >- } else if (version==0 && !isToken(value)) { >+ } else if (version==0 && !isToken(value,literals)) { > buf.append('"'); > buf.append(escapeDoubleQuotes(value,0,value.length())); > buf.append('"'); >- } else if (version==1 && !isToken2(value)) { >+ } else if (version==1 && !isToken2(value,literals)) { > buf.append('"'); > buf.append(escapeDoubleQuotes(value,0,value.length())); > buf.append('"');
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45272
: 22180