Prevent duplicate RequestMatcher in RequestMatcherFactory.antPath()

Closes gh-13706
This commit is contained in:
Johnny Lim 2018-07-05 13:25:40 +09:00 committed by Stephane Nicoll
parent 174cc2bc4e
commit 13202eb278
1 changed files with 2 additions and 2 deletions

View File

@ -299,12 +299,12 @@ public final class EndpointRequest {
List<RequestMatcher> antPath(String... parts) {
List<RequestMatcher> matchers = new ArrayList<>();
this.servletPaths.stream().map((p) -> {
if (StringUtils.hasText(p)) {
if (StringUtils.hasText(p) && !p.equals("/")) {
return p;
}
return "";
}).distinct().forEach((path) -> {
String pattern = (path.equals("/") ? "" : path);
String pattern = path;
for (String part : parts) {
pattern += part;
}