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:31:05 UTC
(tomcat) branch 9.0.x updated: 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 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 4bbc383f0f Add test case for BZ 69234 - URLs for WARs with version information
4bbc383f0f is described below
commit 4bbc383f0fae6eaf8bb151401a3d3ad8db94901a
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org