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

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

markt-asf 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 4e6e4f6efa Fix back-port. 11.0.x and earlier build path differently.
4e6e4f6efa is described below

commit 4e6e4f6efa729bca4aae38b8c0be882821484450
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 a2a28a25dd..600e2985fe 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;
@@ -48,7 +47,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;
 
 /**
@@ -237,13 +235,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.