aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-12-21 13:57:28 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-12-21 13:57:28 +0100
commitc2c68ac0d453944ef81d04f442077f741d350011 (patch)
tree767a5ecd088cabeb3d675a0cfb406ebcf57c34be /jdisc_core/src/test/java/com/yahoo
parent398b5e3b48874c77cc74c7db41628d1440cf6b0e (diff)
Use the rawPath, not the URL-decoded path, of the URI
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo')
-rw-r--r--jdisc_core/src/test/java/com/yahoo/jdisc/application/UriPatternTestCase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/application/UriPatternTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/application/UriPatternTestCase.java
index da48503729d..0ea82508f06 100644
--- a/jdisc_core/src/test/java/com/yahoo/jdisc/application/UriPatternTestCase.java
+++ b/jdisc_core/src/test/java/com/yahoo/jdisc/application/UriPatternTestCase.java
@@ -271,6 +271,17 @@ public class UriPatternTestCase {
assertMatch(httpsPattern, "http://host:443/path", NO_GROUPS);
}
+ @Test
+ public void requireThatUrlEncodingIsNotDoneForPath() {
+ UriPattern encodedSlashPattern = new UriPattern("http://host:80/one%2Fpath");
+ assertMatch(encodedSlashPattern, "http://host:80/one%2Fpath", NO_GROUPS);
+ assertNotMatch(encodedSlashPattern, "http://host:80/one/path");
+
+ UriPattern actualSlashPattern = new UriPattern("http://host:80/two/paths");
+ assertNotMatch(actualSlashPattern, "http://host:80/two%2Fpaths");
+ assertMatch(actualSlashPattern, "http://host:80/two/paths", NO_GROUPS);
+ }
+
private static void assertIllegalPattern(String uri) {
try {
new UriPattern(uri);