(tomcat) branch 9.0.x updated: Fix back-port. 11.0.x and earlier build path differently.

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178663115424.1405739.13653840112902696855@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 03dd9930d7 Fix back-port. 11.0.x and earlier build path differently.
03dd9930d7 is described below

commit 03dd9930d78dfc03465df3ad56094a916c82ab69
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Aug 13 15:24:27 2026 +0100

    Fix back-port. 11.0.x and earlier build path differently.
---
 java/org/apache/catalina/core/AsyncContextImpl.java | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/core/AsyncContextImpl.java b/java/org/apache/catalina/core/AsyncContextImpl.java
index 93da1ca0c7..9747e330aa 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -17,7 +17,6 @@
 package org.apache.catalina.core;
 
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -47,7 +46,6 @@ import org.apache.coyote.RequestInfo;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
-import org.apache.tomcat.util.buf.UDecoder;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -236,13 +234,10 @@ public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
             path = path.substring(cpath.length());
         }
         /*
-         * This is a dispatch of the original request path. That path will always be URI-decoded. That will cause
-         * problems in ServletContext.getRequestDispatcher() if the decoded URI contains a literal '?' as it will be
-         * treated as a query delimiter. Therefore, ignore context.getDispatchersUseEncodedPaths() here and always
-         * encode. Also need to mark this request as ignoring context.getDispatchersUseEncodedPaths() so it is handled
-         * correctly in ServletContext.getRequestDispatcher().
+         * This is a dispatch of the original request path. That path (obtained request.getRequestURI()) will always be
+         * URL-encoded. Therefore, ignore context.getDispatchersUseEncodedPaths() here and mark as always encoded so it
+         * is handled correctly in ServletContext.getRequestDispatcher().
          */
-        path = UDecoder.URLDecode(path, StandardCharsets.UTF_8);
         try {
             uriEncoded.set(Boolean.TRUE);
             dispatch(path);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.