This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new fc4ad2eb58 Change default for useRedirect from true to false
fc4ad2eb58 is described below

commit fc4ad2eb585cabc8e0c0703e4e43c0f8bea0cbb6
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 9 10:16:22 2026 +0100

    Change default for useRedirect from true to false
---
 java/org/apache/catalina/valves/ProxyErrorReportValve.java     | 4 ++--
 test/org/apache/catalina/valves/TestProxyErrorReportValve.java | 7 ++++---
 webapps/docs/changelog.xml                                     | 5 +++++
 webapps/docs/config/valve.xml                                  | 9 ++++++---
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/valves/ProxyErrorReportValve.java 
b/java/org/apache/catalina/valves/ProxyErrorReportValve.java
index dd5f22e219..80883f51a7 100644
--- a/java/org/apache/catalina/valves/ProxyErrorReportValve.java
+++ b/java/org/apache/catalina/valves/ProxyErrorReportValve.java
@@ -58,9 +58,9 @@ public class ProxyErrorReportValve extends ErrorReportValve {
     }
 
     /**
-     * Use a redirect or proxy the response to the specified location. Default 
to redirect.
+     * Use a redirect or proxy the response to the specified location. Default 
to not redirect.
      */
-    protected boolean useRedirect = true;
+    protected boolean useRedirect = false;
 
     /**
      * Returns whether a redirect is used to send the error report to the 
specified location.
diff --git a/test/org/apache/catalina/valves/TestProxyErrorReportValve.java 
b/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
index ecef467206..0010397eec 100644
--- a/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
+++ b/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
@@ -67,6 +67,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest 
{
             }
         }
         Assert.assertNotNull(valve);
+        valve.setUseRedirect(true);
         valve.setProperty("errorCode." + 
HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                 "http://localhost:"; + getPort() + "/error-page");
 
@@ -188,11 +189,11 @@ public class TestProxyErrorReportValve extends 
TomcatBaseTest {
     public void testGetSetProperties() {
         ProxyErrorReportValve valve = new ProxyErrorReportValve();
 
-        Assert.assertTrue(valve.getUseRedirect());
+        Assert.assertFalse(valve.getUseRedirect());
         Assert.assertFalse(valve.getUsePropertiesFile());
 
-        valve.setUseRedirect(false);
-        Assert.assertFalse(valve.getUseRedirect());
+        valve.setUseRedirect(true);
+        Assert.assertTrue(valve.getUseRedirect());
 
         valve.setUsePropertiesFile(true);
         Assert.assertTrue(valve.getUsePropertiesFile());
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e40692ae48..f800281362 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -355,6 +355,11 @@
         Update default web.xml version to match supported Servlet specification
         version. (markt)
       </fix>
+      <fix>
+        Change the default for the <code>useRedirect</code> attribute of the
+        <code>ProxyErrorReportValve</code> from <code>true</code> to
+        <code>false</code>. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 1b9a73fbff..98964bc529 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -2330,9 +2330,12 @@
       </attribute>
 
       <attribute name="useRedirect" required="false">
-        <p>If <code>true</code>, the valve will send a redirect to the URL.
-        If <code>false</code>, the valve will instead proxy the content from
-        the specified URL. The default value is <code>true</code>.</p>
+        <p>If <code>true</code>, the valve will redirect the client to the URL
+        that displays the error and the redirect will include full details of
+        the error including the stack trace. If <code>false</code>, the valve
+        will instead proxy the content from the specified URL which allows the
+        proxy to filter the information presented to the client. The default
+        value is <code>false</code>.</p>
       </attribute>
 
     </attributes>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to