You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2001/03/13 19:18:31 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util RequestUtil.java
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 (rick.rupp@merant.com).
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org