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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new eb735f853f BZ 66875. jakarta.servlet.error.exception shouldn't start 
error handling
eb735f853f is described below

commit eb735f853f7f1607ff82e70b4fe0f985a4622637
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Nov 1 15:25:44 2023 +0000

    BZ 66875. jakarta.servlet.error.exception shouldn't start error handling
---
 java/org/apache/catalina/connector/CoyoteAdapter.java | 4 ++--
 webapps/docs/changelog.xml                            | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 6a32e26948..471d2d6da4 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -233,8 +233,8 @@ public class CoyoteAdapter implements Adapter {
 
             if (request.isAsyncDispatching()) {
                 
connector.getService().getContainer().getPipeline().getFirst().invoke(request, 
response);
-                Throwable t = (Throwable) 
request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
-                if (t != null) {
+                if (response.isError()) {
+                    Throwable t = (Throwable) 
request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
                     asyncConImpl.setErrorState(t, true);
                 }
             }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 89f9ad68db..65cfd9c6be 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,11 @@
         <bug>67926</bug>: <code>PEMFile</code> prints unidentifiable string 
representation
          of ASN.1 OIDs. (michaelo)
       </update>
+      <fix>
+        <bug>66875</bug>: Ensure that setting the request attribute
+        <code>jakarta.servlet.error.exception</code> is not sufficient to
+        trigger error handling for the current request and response. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


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

Reply via email to