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

markt pushed a commit to branch master
in repository

The following commit(s) were added to refs/heads/master by this push:
     new dabf497  Be explicit that UTF-8 is used for encoded dispatcher paths
dabf497 is described below

commit dabf497c0a0b7f12a05e50d861c12d3b659964e4
Author: Mark Thomas <>
AuthorDate: Mon Mar 16 15:21:35 2020 +0000

    Be explicit that UTF-8 is used for encoded dispatcher paths
    Be consistent with AsyncContext and getRequestDispatcher()
 java/org/apache/catalina/core/ | 2 +-
 webapps/docs/config/context.xml                       | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/core/ 
index 026a763..3de49c2 100644
--- a/java/org/apache/catalina/core/
+++ b/java/org/apache/catalina/core/
@@ -429,7 +429,7 @@ public class ApplicationContext implements ServletContext {
         if (getContext().getDispatchersUseEncodedPaths()) {
             // Decode
-            String decodedUri = UDecoder.URLDecode(normalizedUri);
+            String decodedUri = UDecoder.URLDecode(normalizedUri, 
             // Security check to catch attempts to encode /../ sequences
             normalizedUri = RequestUtil.normalize(decodedUri);
diff --git a/webapps/docs/config/context.xml b/webapps/docs/config/context.xml
index bb7c303..d4ea9e9 100644
--- a/webapps/docs/config/context.xml
+++ b/webapps/docs/config/context.xml
@@ -374,7 +374,8 @@
         ares expected to be encoded. This affects both how Tomcat handles calls
         to obtain a request dispatcher as well as how Tomcat generates paths
         used to obtain request dispatchers internally. If not specified, the
-        default value of <code>true</code> is used.</p>
+        default value of <code>true</code> is used. When encoding/decoding 
+        for a request dispatcher, UTF-8 is always used.</p>
       <attribute name="failCtxIfServletStartFails" required="false">

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to