Skip to content

Commit 46a709a

Browse files
committed
Merge branch '3.3.x' into 3.4.x
2 parents 3531071 + 55f67c9 commit 46a709a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ protected final List<ServerWebExchangeMatcher> getDelegateMatchers(Set<String> p
186186
}
187187

188188
private PathPatternParserServerWebExchangeMatcher getDelegateMatcher(String path) {
189+
Assert.notNull(path, "'path' must not be null");
189190
return new PathPatternParserServerWebExchangeMatcher(path + "/**");
190191
}
191192

@@ -310,11 +311,18 @@ protected ServerWebExchangeMatcher createDelegate(PathMappedEndpoints endpoints)
310311
if (this.includeLinks && StringUtils.hasText(endpoints.getBasePath())) {
311312
delegateMatchers.add(new LinksServerWebExchangeMatcher());
312313
}
314+
if (delegateMatchers.isEmpty()) {
315+
return EMPTY_MATCHER;
316+
}
313317
return new OrServerWebExchangeMatcher(delegateMatchers);
314318
}
315319

316320
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
317-
return source.stream().filter(Objects::nonNull).map(this::getEndpointId).map(endpoints::getPath);
321+
return source.stream()
322+
.filter(Objects::nonNull)
323+
.map(this::getEndpointId)
324+
.map(endpoints::getPath)
325+
.filter(Objects::nonNull);
318326
}
319327

320328
@Override

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,18 @@ protected RequestMatcher createDelegate(WebApplicationContext context,
329329
if (this.includeLinks && StringUtils.hasText(basePath)) {
330330
delegateMatchers.addAll(getLinksMatchers(requestMatcherFactory, matcherProvider, basePath));
331331
}
332+
if (delegateMatchers.isEmpty()) {
333+
return EMPTY_MATCHER;
334+
}
332335
return new OrRequestMatcher(delegateMatchers);
333336
}
334337

335338
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
336-
return source.stream().filter(Objects::nonNull).map(this::getEndpointId).map(endpoints::getPath);
339+
return source.stream()
340+
.filter(Objects::nonNull)
341+
.map(this::getEndpointId)
342+
.map(endpoints::getPath)
343+
.filter(Objects::nonNull);
337344
}
338345

339346
@Override
@@ -435,6 +442,7 @@ private static final class RequestMatcherFactory {
435442
RequestMatcher antPath(RequestMatcherProvider matcherProvider, String... parts) {
436443
StringBuilder pattern = new StringBuilder();
437444
for (String part : parts) {
445+
Assert.notNull(part, "'part' must not be null");
438446
pattern.append(part);
439447
}
440448
return matcherProvider.getRequestMatcher(pattern.toString());

0 commit comments

Comments
 (0)