aboutsummaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-04-11 10:45:43 +0200
committerjonmv <venstad@gmail.com>2022-04-11 10:45:43 +0200
commite22b3ccb970ff6917322ec594496c2c2647a05db (patch)
treede6c9ce746bcf8d7c1c620a1e094b9d1717b49ca /container-core
parent11c97272cdc0459ee4b409d7cccb8f38ad908276 (diff)
Avoid segment validation in rule based filter
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/restapi/Path.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/restapi/Path.java b/container-core/src/main/java/com/yahoo/restapi/Path.java
index 80f9391fb56..01bcb627639 100644
--- a/container-core/src/main/java/com/yahoo/restapi/Path.java
+++ b/container-core/src/main/java/com/yahoo/restapi/Path.java
@@ -46,6 +46,11 @@ public class Path {
this.path = HttpURL.Path.parse(uri.getRawPath(), validator);
}
+ /** Create a new Path for matching the given URI against patterns, without any segment validation. */
+ public static Path withoutValidation(URI uri) {
+ return new Path(uri, __ -> { });
+ }
+
private boolean matchesInner(String pathSpec) {
values.clear();
List<String> specElements = HttpURL.Path.parse(pathSpec).segments();