2012/10/5 Christopher Schultz <ch...@christopherschultz.net>:
> Konstantin,
>
> On 10/5/12 8:45 AM, Konstantin Kolinko wrote:
>> 2012/10/4  <ma...@apache.org>:
>>> Author: markt
>>> Date: Thu Oct  4 14:55:59 2012
>>> New Revision: 1394104
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1394104&view=rev
>>> Log:
>>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48692
>>> Provide option to parse application/x-www-form-urlencoded PUT requests
>>>
>>> Modified:
>>>     tomcat/tc6.0.x/trunk/STATUS.txt
>>>     tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Connector.java
>>>     
>>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties
>>>     tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java
>>>     tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
>>>     tomcat/tc6.0.x/trunk/webapps/docs/config/ajp.xml
>>>     tomcat/tc6.0.x/trunk/webapps/docs/config/http.xml
>>>
>>
>>> (...)
>>> Modified: 
>>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java
>>> URL: 
>>> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java?rev=1394104&r1=1394103&r2=1394104&view=diff
>>> ==============================================================================
>>> --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java 
>>> (original)
>>> +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Request.java 
>>> Thu Oct  4 14:55:59 2012
>>> @@ -2596,7 +2596,7 @@ public class Request
>>>          if (usingInputStream || usingReader)
>>>              return;
>>>
>>> -        if (!getMethod().equalsIgnoreCase("POST"))
>>> +        if( !getConnector().isParseBodyMethod(getMethod()) )
>>>              return;
>>
>>
>> It seems a bug crawled in.
>> The old behaviour: case-insensitive. equalsIgnoreCase("POST")
>> The new behaviour: case-sensitive  (parseBodyMethodsSet.contains(method))
>>
>> That is unless the method name is converted to uppercase somewhere.
>> I have not yet checked what HTTP spec says on method names.
>
> RFCs 2616, 2068, and 1945 all agree that method name is case-sensitive:
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
>

OK. Agreed.

Looking at Servlet spec 2.5, SRV.3.1.1 says "The HTTP method is POST".


I tested 6.0.35 using telnet as a client.
The result is that it sometimes allow lowercase methods (or maybe it
does not care about a method in that case) but generally it responds
with an error.

get /index.jsp HTTP/1.0
post /index.jsp HTTP/1.0
- result in the welcome page being rendered

get / HTTP/1.0
- results in
HTTP/1.1 501 Not Implemented

The getMethod() call returns the name as is, as can be seen by adding
%m to the AccessLogValve pattern.

So there is no need for case-insensivity there. If someone has odd
clients that use unusual methods, one can add their specific values to
the parseBodyMethods list.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to