Commit 13202eb2 authored by Johnny Lim's avatar Johnny Lim Committed by Stephane Nicoll

Prevent duplicate RequestMatcher in RequestMatcherFactory.antPath()

Closes gh-13706
parent 174cc2bc
...@@ -299,12 +299,12 @@ public final class EndpointRequest { ...@@ -299,12 +299,12 @@ public final class EndpointRequest {
List<RequestMatcher> antPath(String... parts) { List<RequestMatcher> antPath(String... parts) {
List<RequestMatcher> matchers = new ArrayList<>(); List<RequestMatcher> matchers = new ArrayList<>();
this.servletPaths.stream().map((p) -> { this.servletPaths.stream().map((p) -> {
if (StringUtils.hasText(p)) { if (StringUtils.hasText(p) && !p.equals("/")) {
return p; return p;
} }
return ""; return "";
}).distinct().forEach((path) -> { }).distinct().forEach((path) -> {
String pattern = (path.equals("/") ? "" : path); String pattern = path;
for (String part : parts) { for (String part : parts) {
pattern += part; pattern += part;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment