This is an automated email from the ASF dual-hosted git repository. markt 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 dd9b9a4bfb Add test case for BZ 69234 - URLs for WARs with version information dd9b9a4bfb is described below commit dd9b9a4bfbfbb6504c55b484f8d0569e523c2ff6 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jul 31 15:57:15 2024 +0100 Add test case for BZ 69234 - URLs for WARs with version information e.g. test##001.war https://bz.apache.org/bugzilla/show_bug.cgi?id=69234 --- test/org/apache/tomcat/util/buf/TesterUriUtilBase.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java b/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java index b176788bf4..918a913c3e 100644 --- a/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java +++ b/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java @@ -85,6 +85,24 @@ public abstract class TesterUriUtilBase { } + @Test + public void testBuildJarUrl05() throws MalformedURLException { + File jarFile = new File("/patha/pathb/pathc/war##001.war"); + String result = UriUtil.buildJarUrl(jarFile).toString(); + + int index = result.indexOf("!/"); + Assert.assertEquals(result, result.length() - 2, index); + + index = result.indexOf(separator + "/"); + Assert.assertEquals(result, -1, index); + + // Ensure there is no double decoding + // https://bz.apache.org/bugzilla/show_bug.cgi?id=69234 + index = result.indexOf("%25"); + Assert.assertEquals(result, -1, index); + } + + @Test public void testWarToJar01() throws MalformedURLException { doTestWarToJar("^"); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org