remm        2004/10/14 15:53:14

  Modified:    util/java/org/apache/tomcat/util/http ServerCookie.java
  Log:
  - Sync with Cookie, by adding ' ' as a special char. (bug 31090)
  - If a special char is present, the string will be quoted. If the client doesn't 
support it, too bad. No IAE will be thrown.
  
  Revision  Changes    Path
  1.7       +10 -15    
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/ServerCookie.java
  
  Index: ServerCookie.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/ServerCookie.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServerCookie.java 17 Sep 2004 18:34:19 -0000      1.6
  +++ ServerCookie.java 14 Oct 2004 22:53:14 -0000      1.7
  @@ -128,7 +128,7 @@
       // from RFC 2068, token special case characters
       //
       // private static final String tspecials = "()<>@,;:\\\"/[]?={} \t";
  -    private static final String tspecials = ",;";
  +    private static final String tspecials = ",; ";
   
       /*
        * Tests a string and returns true if the string counts as a
  @@ -272,20 +272,15 @@
       }
   
       public static void maybeQuote (int version, StringBuffer buf,
  -                                    String value)
  -    {
  -     // special case - a \n or \r  shouldn't happen in any case
  -     if ( isToken (value))
  -       buf.append (value);
  -     else {
  -         if(version==0)
  -             throw new IllegalArgumentException( value );
  -         else {
  -             buf.append ('"');
  -             buf.append (value);
  -             buf.append ('"');
  -         }
  -     }
  +            String value) {
  +        // special case - a \n or \r  shouldn't happen in any case
  +        if (isToken(value)) {
  +            buf.append(value);
  +        } else {
  +            buf.append('"');
  +            buf.append(value);
  +            buf.append('"');
  +        }
       }
   
       // log
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to