You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2024/07/31 15:20:11 UTC
(tomcat) 01/02: Add test case for BZ 69234 - URLs for WARs with version information
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit eb6a46861c99efff1177d026582913f3afa80691
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 1de4724130..8356783e30 100644
--- a/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java
+++ b/test/org/apache/tomcat/util/buf/TesterUriUtilBase.java
@@ -86,6 +86,24 @@ public abstract class TesterUriUtilBase {
}
+ @Test
+ public void testBuildJarUrl05() throws IOException {
+ 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 testWarToJar02() throws IOException {
doTestWarToJar("*");
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org