2012/8/31  <ma...@apache.org>:
> Author: markt
> Date: Thu Aug 30 21:57:15 2012
> New Revision: 1379178
>
> URL: http://svn.apache.org/viewvc?rev=1379178&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53677
> Ensure a 500 response of the HTTP headers exceed the size limit
>

> --- tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java 
> (original)
> +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractOutputBuffer.java Thu 
> Aug 30 21:57:15 2012
> @@ -250,7 +250,10 @@ public abstract class AbstractOutputBuff
>
>          // Recycle Request object
>          response.recycle();
> -
> +        // These will need to be reset if the reset was triggered by the 
> error
> +        // handling if the headers were too large
> +        pos = 0;
> +        byteCount = 0;
>      }

There is a use case when there is custom error page for 401 response.
In that case authentication headers are set before  custom error page
is requested and have to be preserved.  (BZ 42409)

I have yet to check it, but if that processing is broken by this, I will be -1.



> --- tomcat/trunk/java/org/apache/coyote/http11/HeadersTooLargeException.java 
> (added)
> +++ tomcat/trunk/java/org/apache/coyote/http11/HeadersTooLargeException.java 
> Thu Aug 30 21:57:15 2012
> @@ -0,0 +1,42 @@
> +/*
> + *  Licensed to the Apache Software Foundation (ASF) under one or more
> + *  contributor license agreements.  See the NOTICE file distributed with
> + *  this work for additional information regarding copyright ownership.
> + *  The ASF licenses this file to You under the Apache License, Version 2.0
> + *  (the "License"); you may not use this file except in compliance with
> + *  the License.  You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + *  Unless required by applicable law or agreed to in writing, software
> + *  distributed under the License is distributed on an "AS IS" BASIS,
> + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> + *  See the License for the specific language governing permissions and
> + *  limitations under the License.
> + */
> +package org.apache.coyote.http11;
> +
> +/**
> + * Exception used to mark the specific error condition of the HTTP headers
> + * exceeding the maximum permitted size.
> + */
> +public class HeadersTooLargeException extends IllegalStateException {
> +
> +    private static final long serialVersionUID = 1L;
> +
> +    public HeadersTooLargeException() {
> +        super();
> +    }
> +
> +    public HeadersTooLargeException(String message, Throwable cause) {
> +        super(message, cause);
> +    }
> +
> +    public HeadersTooLargeException(String s) {
> +        super(s);
> +    }
> +
> +    public HeadersTooLargeException(Throwable cause) {
> +        super(cause);
> +    }

I wonder whether UCDetector will remove some of the above.
Just joking.
If it is supposed to be used by 3rd parties, it is better to keep all
4 constructors.

> +}
>

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