remm        02/02/21 14:51:55

  Modified:    catalina/src/share/org/apache/catalina/util CookieTools.java
                        RequestUtil.java
  Log:
  - Tentative fix for the cookie encoding problem (bug 4295). Please review (esp 
Costin).
  - This patch could cause compatibility problems (as seen in bug 6630).
  - The question is: should this patch (if correct) be ported to the 4.0.x branch ?
    I'd say yes, since we should have a standards-compliant behavior, even if it 
creates
    some problems at first. Comments ?
  
  Revision  Changes    Path
  1.7       +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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CookieTools.java  25 Sep 2001 20:40:42 -0000      1.6
  +++ CookieTools.java  21 Feb 2002 22:51:55 -0000      1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
 1.6 2001/09/25 20:40:42 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2001/09/25 20:40:42 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
 1.7 2002/02/21 22:51:55 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/02/21 22:51:55 $
    *
    * ====================================================================
    *
  @@ -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.19      +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.19
  diff -u -r1.18 -r1.19
  --- RequestUtil.java  15 Aug 2001 23:19:55 -0000      1.18
  +++ RequestUtil.java  21 Feb 2002 22:51:55 -0000      1.19
  @@ -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.19 2002/02/21 22:51:55 remm Exp $
  + * $Revision: 1.19 $
  + * $Date: 2002/02/21 22:51:55 $
    *
    * ====================================================================
    *
  @@ -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.19 $ $Date: 2002/02/21 22:51:55 $
    */
   
   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]>

Reply via email to