Skip to content

Commit 25b0a4a

Browse files
committed
Merge branch '2.5.x' into 2.6.x
Fixes gh-35438
2 parents c984ddb + 086b1e5 commit 25b0a4a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Collection;
2222
import java.util.Collections;
2323
import java.util.List;
24+
import java.util.function.Supplier;
2425
import java.util.stream.Collectors;
2526

2627
import org.springframework.beans.BeansException;
@@ -64,6 +65,7 @@
6465
import org.springframework.security.web.server.WebFilterChainProxy;
6566
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
6667
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
68+
import org.springframework.util.function.SingletonSupplier;
6769
import org.springframework.web.cors.CorsConfiguration;
6870
import org.springframework.web.reactive.function.client.WebClient;
6971
import org.springframework.web.server.WebFilter;
@@ -156,25 +158,26 @@ private CorsConfiguration getCorsConfiguration() {
156158
static class IgnoredPathsSecurityConfiguration {
157159

158160
@Bean
159-
WebFilterChainPostProcessor webFilterChainPostProcessor(
160-
CloudFoundryWebFluxEndpointHandlerMapping handlerMapping) {
161+
static WebFilterChainPostProcessor webFilterChainPostProcessor(
162+
ObjectProvider<CloudFoundryWebFluxEndpointHandlerMapping> handlerMapping) {
161163
return new WebFilterChainPostProcessor(handlerMapping);
162164
}
163165

164166
}
165167

166168
static class WebFilterChainPostProcessor implements BeanPostProcessor {
167169

168-
private final PathMappedEndpoints pathMappedEndpoints;
170+
private Supplier<PathMappedEndpoints> pathMappedEndpoints;
169171

170-
WebFilterChainPostProcessor(CloudFoundryWebFluxEndpointHandlerMapping handlerMapping) {
171-
this.pathMappedEndpoints = new PathMappedEndpoints(BASE_PATH, handlerMapping::getAllEndpoints);
172+
WebFilterChainPostProcessor(ObjectProvider<CloudFoundryWebFluxEndpointHandlerMapping> handlerMapping) {
173+
this.pathMappedEndpoints = SingletonSupplier
174+
.of(() -> new PathMappedEndpoints(BASE_PATH, () -> handlerMapping.getObject().getAllEndpoints()));
172175
}
173176

174177
@Override
175178
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
176179
if (bean instanceof WebFilterChainProxy) {
177-
return postProcess((WebFilterChainProxy) bean, this.pathMappedEndpoints);
180+
return postProcess((WebFilterChainProxy) bean, this.pathMappedEndpoints.get());
178181
}
179182
return bean;
180183
}

0 commit comments

Comments
 (0)