Author: markt
Date: Fri May 11 08:34:21 2018
New Revision: 1831389
URL: http://svn.apache.org/viewvc?rev=1831389&view=rev
Log:
When the header limit is exceeded before the protocol is read (e.g. with
excessive new lines before the request line), set the protocol to avoid the
missing protocol triggering a 505 error masking the real error code.
Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java?rev=1831389&r1=1831388&r2=1831389&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java Fri May
11 08:34:21 2018
@@ -711,6 +711,10 @@ public class Http11InputBuffer implement
if (parsingHeader) {
if (byteBuffer.limit() >= headerBufferSize) {
+ if (parsingRequestLine) {
+ // Avoid unknown protocol triggering an additional error
+ request.protocol().setString(Constants.HTTP_11);
+ }
throw new
IllegalArgumentException(sm.getString("iib.requestheadertoolarge.error"));
}
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]