diff --git a/vertx-web/src/main/java/io/vertx/ext/web/impl/RouteState.java b/vertx-web/src/main/java/io/vertx/ext/web/impl/RouteState.java index d3371742a0..b2d5ca2509 100644 --- a/vertx-web/src/main/java/io/vertx/ext/web/impl/RouteState.java +++ b/vertx-web/src/main/java/io/vertx/ext/web/impl/RouteState.java @@ -1312,16 +1312,15 @@ private static boolean pathMatchesExact(String base, String other, boolean signi if (other.charAt(len -1) == '/') { // final slash is not significant, ignore it len--; + if (base.length() != len) { + return false; + } + // content must match + return other.regionMatches(0, base, 0, len); } } - - // lengths are not the same (fail) - if (base.length() != len) { - return false; - } - // content must match - return other.regionMatches(0, base, 0, len); + return other.equals(base); } private void addPathParam(RoutingContext context, String name, String value) {