tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <...@latchkey.com>
Subject FW: Simple tomcat bug with fix
Date Thu, 15 Jun 2000 18:11:52 GMT
someone want to take care of this one?

thanks,

-jon

----------
From: Chris Sokol <CSokol@shootinggallery.com>
Date: Thu, 15 Jun 2000 13:22:20 -0400
To: "'jon@apache.org'" <jon@apache.org>
Subject: FW: Simple tomcat bug with fix

I have found a very simple bug in Tomcat, which still exists in the latest
nightly snapshot.

In the file TOMCAT_HOME/src/share/org/apache/tomcat/util/RequestUtil.java,
on line 89, there is a statement to change the browser submitted
content-type header to discard the part that comes after the semi-colon.
That is, to change
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
into
Content-Type: application/x-www-form-urlencoded

The statement reads:
contentType=contentType.substring(0,contentType.indexOf(";")-1);

However, this truncates the last character of the actual content-type,
yielding
Content-Type: application/x-www-form-urlencode

Just drop the -1 to fix.

Sincerely,
Chris Sokol



Mime
View raw message