Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46125 for NIO and APR connectors
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 12 Dec 2008 15:41:13 +0000 (15:41 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 12 Dec 2008 15:41:13 +0000 (15:41 +0000)
Change the exception if the headers are too big to force a 400 status code rather than the current 200

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@726052 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/http11/InternalAprInputBuffer.java
java/org/apache/coyote/http11/InternalNioInputBuffer.java

index f1137cf..a00ce8c 100644 (file)
@@ -751,7 +751,7 @@ public class InternalAprInputBuffer implements InputBuffer {
         if (parsingHeader) {
 
             if (lastValid == buf.length) {
-                throw new IOException
+                throw new IllegalArgumentException
                     (sm.getString("iib.requestheadertoolarge.error"));
             }
 
index 2ee2e07..3438d36 100644 (file)
@@ -876,7 +876,7 @@ public class InternalNioInputBuffer implements InputBuffer {
         if (parsingHeader) {
 
             if (lastValid == buf.length) {
-                throw new IOException
+                throw new IllegalArgumentException
                     (sm.getString("iib.requestheadertoolarge.error"));
             }