Merge branch '3.3.x' into 3.4.x

This commit is contained in:
Moritz Halbritter 2025-04-24 08:31:13 +02:00
commit 46a709a850
2 changed files with 18 additions and 2 deletions

View File

@ -186,6 +186,7 @@ public final class EndpointRequest {
}
private PathPatternParserServerWebExchangeMatcher getDelegateMatcher(String path) {
Assert.notNull(path, "'path' must not be null");
return new PathPatternParserServerWebExchangeMatcher(path + "/**");
}
@ -310,11 +311,18 @@ public final class EndpointRequest {
if (this.includeLinks && StringUtils.hasText(endpoints.getBasePath())) {
delegateMatchers.add(new LinksServerWebExchangeMatcher());
}
if (delegateMatchers.isEmpty()) {
return EMPTY_MATCHER;
}
return new OrServerWebExchangeMatcher(delegateMatchers);
}
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
return source.stream().filter(Objects::nonNull).map(this::getEndpointId).map(endpoints::getPath);
return source.stream()
.filter(Objects::nonNull)
.map(this::getEndpointId)
.map(endpoints::getPath)
.filter(Objects::nonNull);
}
@Override

View File

@ -329,11 +329,18 @@ public final class EndpointRequest {
if (this.includeLinks && StringUtils.hasText(basePath)) {
delegateMatchers.addAll(getLinksMatchers(requestMatcherFactory, matcherProvider, basePath));
}
if (delegateMatchers.isEmpty()) {
return EMPTY_MATCHER;
}
return new OrRequestMatcher(delegateMatchers);
}
private Stream<String> streamPaths(List<Object> source, PathMappedEndpoints endpoints) {
return source.stream().filter(Objects::nonNull).map(this::getEndpointId).map(endpoints::getPath);
return source.stream()
.filter(Objects::nonNull)
.map(this::getEndpointId)
.map(endpoints::getPath)
.filter(Objects::nonNull);
}
@Override
@ -435,6 +442,7 @@ public final class EndpointRequest {
RequestMatcher antPath(RequestMatcherProvider matcherProvider, String... parts) {
StringBuilder pattern = new StringBuilder();
for (String part : parts) {
Assert.notNull(part, "'part' must not be null");
pattern.append(part);
}
return matcherProvider.getRequestMatcher(pattern.toString());