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

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

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


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

commit 38bb80940863d9c8dcebe053808ea1c186afd2da
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 2e8f1ccc6a..a3ae106adc 100644
--- a/java/org/apache/catalina/core/AsyncContextImpl.java
+++ b/java/org/apache/catalina/core/AsyncContextImpl.java
@@ -18,7 +18,6 @@ package org.apache.catalina.core;
 
 import java.io.IOException;
 import java.io.Serial;
-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;
 
 /**
@@ -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.