Skip to content

Commit dccf378

Browse files
committed
Polish CloudFoundryActuatorAutoConfiguration
1 parent e098533 commit dccf378

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
6868
import org.springframework.security.web.util.matcher.OrRequestMatcher;
6969
import org.springframework.security.web.util.matcher.RequestMatcher;
70-
import org.springframework.util.CollectionUtils;
7170
import org.springframework.web.cors.CorsConfiguration;
7271
import org.springframework.web.servlet.DispatcherServlet;
7372

@@ -125,8 +124,8 @@ public CloudFoundryWebEndpointServletHandlerMapping cloudFoundryWebEndpointServl
125124
allEndpoints.addAll(webEndpoints);
126125
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
127126
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
128-
return new CloudFoundryWebEndpointServletHandlerMapping(new EndpointMapping("/cloudfoundryapplication"),
129-
webEndpoints, endpointMediaTypes, getCorsConfiguration(), securityInterceptor, allEndpoints);
127+
return new CloudFoundryWebEndpointServletHandlerMapping(new EndpointMapping(BASE_PATH), webEndpoints,
128+
endpointMediaTypes, getCorsConfiguration(), securityInterceptor, allEndpoints);
130129
}
131130

132131
private CloudFoundrySecurityInterceptor getSecurityInterceptor(RestTemplateBuilder restTemplateBuilder,
@@ -189,9 +188,7 @@ public void customize(WebSecurity web) {
189188
.forEach((path) -> requestMatchers.add(new AntPathRequestMatcher(path + "/**")));
190189
requestMatchers.add(new AntPathRequestMatcher(BASE_PATH));
191190
requestMatchers.add(new AntPathRequestMatcher(BASE_PATH + "/"));
192-
if (!CollectionUtils.isEmpty(requestMatchers)) {
193-
web.ignoring().requestMatchers(new OrRequestMatcher(requestMatchers));
194-
}
191+
web.ignoring().requestMatchers(new OrRequestMatcher(requestMatchers));
195192
}
196193

197194
}

0 commit comments

Comments
 (0)