remm 02/02/21 20:02:27
Modified: catalina/src/share/org/apache/catalina/util Tag:
tomcat_40_branch CookieTools.java RequestUtil.java
Log:
- Since nobody complained, I'm porting the patch to disable URL encoding /
decoding on cookies to the 4.0 branch (the patch is simple to revert anyway).
- Warning: this may cause compatibility problems, and will be indicated very
explicitely in the release notes. I think corectness should come first (esp since
there are already discrepancies in behavior between connectors, as seen in bug
6630;
Costin: great argument to force me to fix the problem, BTW ;-)).
Revision Changes Path
No revision
No revision
1.5.2.2 +7 -8
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java
Index: CookieTools.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- CookieTools.java 25 Sep 2001 20:44:42 -0000 1.5.2.1
+++ CookieTools.java 22 Feb 2002 04:02:27 -0000 1.5.2.2
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
1.5.2.1 2001/09/25 20:44:42 craigmcc Exp $
- * $Revision: 1.5.2.1 $
- * $Date: 2001/09/25 20:44:42 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
1.5.2.2 2002/02/22 04:02:27 remm Exp $
+ * $Revision: 1.5.2.2 $
+ * $Date: 2002/02/22 04:02:27 $
*
* ====================================================================
*
@@ -63,7 +63,7 @@
package org.apache.catalina.util;
-import java.net.URLEncoder;
+
import java.text.*;
import java.util.*;
@@ -115,9 +115,9 @@
if (value == null)
value = "";
- buf.append(URLEncoder.encode(name));
+ buf.append(name);
buf.append("=");
- maybeQuote(version, buf, URLEncoder.encode(value));
+ maybeQuote(version, buf, value);
// add version 1 specific information
if (version == 1) {
@@ -127,8 +127,7 @@
// Comment=comment
if (cookie.getComment() != null) {
buf.append (";Comment=");
- maybeQuote (version, buf,
- URLEncoder.encode(cookie.getComment()));
+ maybeQuote (version, buf, cookie.getComment());
}
}
1.18.2.1 +6 -6
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/RequestUtil.java
Index: RequestUtil.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -r1.18 -r1.18.2.1
--- RequestUtil.java 15 Aug 2001 23:19:55 -0000 1.18
+++ RequestUtil.java 22 Feb 2002 04:02:27 -0000 1.18.2.1
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
1.18 2001/08/15 23:19:55 craigmcc Exp $
- * $Revision: 1.18 $
- * $Date: 2001/08/15 23:19:55 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
1.18.2.1 2002/02/22 04:02:27 remm Exp $
+ * $Revision: 1.18.2.1 $
+ * $Date: 2002/02/22 04:02:27 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
*
* @author Craig R. McClanahan
* @author Tim Tye
- * @version $Revision: 1.18 $ $Date: 2001/08/15 23:19:55 $
+ * @version $Revision: 1.18.2.1 $ $Date: 2002/02/22 04:02:27 $
*/
public final class RequestUtil {
@@ -296,8 +296,8 @@
try {
int equals = token.indexOf('=');
if (equals > 0) {
- String name = URLDecode(token.substring(0, equals).trim());
- String value = URLDecode(token.substring(equals+1).trim());
+ String name = token.substring(0, equals).trim();
+ String value = token.substring(equals+1).trim();
cookies.add(new Cookie(name, value));
}
} catch (Throwable e) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>