From e22b3ccb970ff6917322ec594496c2c2647a05db Mon Sep 17 00:00:00 2001 From: jonmv Date: Mon, 11 Apr 2022 10:45:43 +0200 Subject: Avoid segment validation in rule based filter --- container-core/src/main/java/com/yahoo/restapi/Path.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'container-core') 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 specElements = HttpURL.Path.parse(pathSpec).segments(); -- cgit v1.2.3