marcsaeg    01/03/13 10:18:30

  Modified:    src/share/org/apache/tomcat/util Tag: tomcat_32
                        RequestUtil.java
  Log:
  Strip any double-quote characters from around the charset value
  in the Content-type header.
  
  Coincidentally, there was a recent thread on the HTTP WG mailing
  list about this topic and the conclusion was that that specification
  does support enclosing the value of the charset attribute in quotes
  (although I'm at a loss as to why anyone would want to).
  
  Reported by Rick Rupp ([EMAIL PROTECTED]).
  
  PR: 650/ Buzzilla 364
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.14.2.2  +4 -0      
jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/RequestUtil.java
  
  Index: RequestUtil.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/RequestUtil.java,v
  retrieving revision 1.14.2.1
  retrieving revision 1.14.2.2
  diff -u -r1.14.2.1 -r1.14.2.2
  --- RequestUtil.java  2000/07/09 02:32:57     1.14.2.1
  +++ RequestUtil.java  2001/03/13 18:18:26     1.14.2.2
  @@ -384,6 +384,10 @@
               return null;
           }
           String afterCharset = afterSemi.substring(charsetLocation + 8);
  +        // The charset value in a Content-Type header is allowed to be quoted
  +        // and charset values can't contain quotes.  Just convert any quote
  +        // chars into spaces and let trim clean things up.
  +        afterCharset = afterCharset.replace('"', ' ');
           String encoding = afterCharset.trim();
           return encoding;
       }
  
  
  

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

Reply via email to