Skip to content

Commit d98086c

Browse files
committed
Merge branch '3.4.x'
2 parents 53e0685 + 46a709a commit d98086c

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ protected final List<ServerWebExchangeMatcher> getDelegateMatchers(Set<String> p
190190
}
191191

192192
private PathPatternParserServerWebExchangeMatcher getDelegateMatcher(String path, HttpMethod httpMethod) {
193+
Assert.notNull(path, "'path' must not be null");
193194
return new PathPatternParserServerWebExchangeMatcher(path + "/**", httpMethod);
194195
}
195196

@@ -328,11 +329,18 @@ protected ServerWebExchangeMatcher createDelegate(PathMappedEndpoints endpoints)
328329
if (this.includeLinks && StringUtils.hasText(endpoints.getBasePath())) {
329330
delegateMatchers.add(new LinksServerWebExchangeMatcher());
330331
}
332+
if (delegateMatchers.isEmpty()) {
333+
return EMPTY_MATCHER;
334+
}
331335
return new OrServerWebExchangeMatcher(delegateMatchers);
332336
}
333337

334338
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
335-
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);
336344
}
337345

338346
@Override

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,18 @@ protected RequestMatcher createDelegate(WebApplicationContext context,
362362
if (this.includeLinks && StringUtils.hasText(basePath)) {
363363
delegateMatchers.addAll(getLinksMatchers(requestMatcherFactory, matcherProvider, basePath));
364364
}
365+
if (delegateMatchers.isEmpty()) {
366+
return EMPTY_MATCHER;
367+
}
365368
return new OrRequestMatcher(delegateMatchers);
366369
}
367370

368371
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
369-
return source.stream().filter(Objects::nonNull).map(this::getEndpointId).map(endpoints::getPath);
372+
return source.stream()
373+
.filter(Objects::nonNull)
374+
.map(this::getEndpointId)
375+
.map(endpoints::getPath)
376+
.filter(Objects::nonNull);
370377
}
371378

372379
@Override
@@ -484,6 +491,7 @@ private static final class RequestMatcherFactory {
484491
RequestMatcher antPath(RequestMatcherProvider matcherProvider, HttpMethod httpMethod, String... parts) {
485492
StringBuilder pattern = new StringBuilder();
486493
for (String part : parts) {
494+
Assert.notNull(part, "'part' must not be null");
487495
pattern.append(part);
488496
}
489497
return matcherProvider.getRequestMatcher(pattern.toString(), httpMethod);

0 commit comments

Comments
 (0)