You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/11/28 21:19:49 UTC

[Bug 54220] New: ErrorReportValve invoked on non-error responses too

https://issues.apache.org/bugzilla/show_bug.cgi?id=54220

            Bug ID: 54220
           Summary: ErrorReportValve invoked on non-error responses too
           Product: Tomcat 6
           Version: 6.0.36
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: 1983-01-06@gmx.net
    Classification: Unclassified

If you issue a response.setStatus(404) from a servlet, you expect as per spec
that the response is left untouched. No error page written. There is sendError
for that.

Unfortunately, ErrorReportValve reacts on line 158
> if ((statusCode < 400) || (response.getContentCount() > 0))
>            return;

If you take a look at the StandardHostValve, it invokes error handling on line
316
> if (!response.isError())
>            return;
On errors only (correct behavior).

The ErrorReportValve must react on response.isError() == true only. Regardless
of the status code or the content count.
The Javadoc does not limit this to status codes >= 400 but is says that
reponse.sendError() has to clears buffers. As far I understand that, regardless
of the response body is disposed and the error reponse is always written.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54220] ErrorReportValve invoked on non-error responses too

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54220

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Opps. Need to keep this open until 6.0x. is fixed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54220] ErrorReportValve invoked on non-error responses too

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54220

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> ---
Fixed in Tomcat 6 by r1417925 , will be in 6.0.37 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54220] ErrorReportValve invoked on non-error responses too

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54220

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk and 7.0.x and will be included in 7.0.34 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54220] ErrorReportValve invoked on non-error responses too

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54220

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Proposed for 6.0.x

-- 
You are receiving this mail because:
You are the assignee for the bug.

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