This is an automated email from the ASF dual-hosted git repository. markt 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 a8064cf16f Fix BZ 66388 - correct regression in removal of URL constructors a8064cf16f is described below commit a8064cf16f3635f84e11210d4b4f231e17c9dd5d Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Dec 14 18:21:35 2022 +0000 Fix BZ 66388 - correct regression in removal of URL constructors --- .../apache/catalina/webresources/AbstractArchiveResource.java | 5 ++++- webapps/docs/changelog.xml | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/webresources/AbstractArchiveResource.java b/java/org/apache/catalina/webresources/AbstractArchiveResource.java index 534a3db429..8e4daffddc 100644 --- a/java/org/apache/catalina/webresources/AbstractArchiveResource.java +++ b/java/org/apache/catalina/webresources/AbstractArchiveResource.java @@ -22,11 +22,14 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.security.cert.Certificate; import java.util.concurrent.atomic.AtomicBoolean; import java.util.jar.JarEntry; import java.util.jar.Manifest; +import org.apache.catalina.util.URLEncoder; + public abstract class AbstractArchiveResource extends AbstractResource { private final AbstractArchiveResourceSet archiveResourceSet; @@ -139,7 +142,7 @@ public abstract class AbstractArchiveResource extends AbstractResource { @Override public URL getURL() { - String url = baseUrl + resource.getName(); + String url = baseUrl + URLEncoder.DEFAULT.encode(resource.getName(), StandardCharsets.UTF_8); try { return new URI(url).toURL(); } catch (MalformedURLException | URISyntaxException e) { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index d9479669f6..e5b523842d 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -105,6 +105,16 @@ issues do not "pop up" wrt. others). --> <section name="Tomcat 9.0.71 (remm)" rtext="in development"> + <subsection name="Catalina"> + <changelog> + <fix> + <bug>66388</bug>: Correct a regression in the refactoring that replaced + the use of the <code>URL</code> constructors. The regression broke + lookups for resources that contained one or more characters in their + name that required escaping when used in a URI path. (markt) + </fix> + </changelog> + </subsection> </section> <section name="Tomcat 9.0.70 (remm)" rtext="2022-12-05"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org