From 13202eb278c85cf4879fe7e7e9d6b61d46ce3fe7 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 5 Jul 2018 13:25:40 +0900 Subject: [PATCH] Prevent duplicate RequestMatcher in RequestMatcherFactory.antPath() Closes gh-13706 --- .../autoconfigure/security/servlet/EndpointRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java index dbcc6da201..f1c41b4789 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java @@ -299,12 +299,12 @@ public final class EndpointRequest { List antPath(String... parts) { List 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; }