From 26d16461a590a362a05c710c9bc88414ac0150d7 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 10 Jun 2021 20:52:21 +1000 Subject: [PATCH] Update jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java --- jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java index 54542599b5c7..d8deb522fe8b 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java @@ -1328,7 +1328,10 @@ else if (_path != null) */ private void checkSegment(String uri, int segment, int end, boolean param) { - // If we have previously seen an empty segment, then it was not the last segment and was thus ambiguous. + // This method is called once for every segment parsed. + // A URI like "/foo/" has two segments: "foo" and an empty segment. + // Empty segments are only ambiguous if they are not the last segment + // So if this method is called for any segment and we have previously seen an empty segment, then it was ambiguous if (_emptySegment) _ambiguous.add(Ambiguous.EMPTY);