Author: kkolinko
Date: Thu Dec  6 14:51:43 2012
New Revision: 1417925

URL: http://svn.apache.org/viewvc?rev=1417925&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54220
The ErrorReportValve should only generate an error response if the error flag 
on the response is true.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1417925&r1=1417924&r2=1417925&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Dec  6 14:51:43 2012
@@ -94,12 +94,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54220
-  ErrorReportValve invoked on non-error responses
-  http://svn.apache.org/viewvc?rev=1416537&view=rev (ErrorReportValve.java 
only)
-  +1: markt, kfujino, kkolinko, schultz
-  -1:
-
 
 PATCHES/ISSUES THAT ARE STALLED
 

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1417925&r1=1417924&r2=1417925&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/valves/ErrorReportValve.java 
Thu Dec  6 14:51:43 2012
@@ -156,8 +156,10 @@ public class ErrorReportValve
 
         // Do nothing on a 1xx, 2xx and 3xx status
         // Do nothing if anything has been written already
-        if ((statusCode < 400) || (response.getContentCount() > 0))
+        if (statusCode < 400 || response.getContentCount() > 0 ||
+                !response.isError()) {
             return;
+        }
 
         String message = RequestUtil.filter(response.getMessage());
         if (message == null) {

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1417925&r1=1417924&r2=1417925&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Dec  6 14:51:43 2012
@@ -58,6 +58,10 @@
         <bug>54087</bug>: Correctly handle (ignore) invalid If-Modified-Since
         header rather than throwing an exception. (markt/kkolinko)
       </fix>
+      <fix>
+        <bug>54220</bug>: Ensure the ErrorReportValve only generates an error
+        report if the error flag on the response has been set. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">



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

Reply via email to