Merge branch '3.4.x'

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

View File

@@ -190,6 +190,7 @@ public final class EndpointRequest {
}
private PathPatternParserServerWebExchangeMatcher getDelegateMatcher(String path, HttpMethod httpMethod) {
Assert.notNull(path, "'path' must not be null");
return new PathPatternParserServerWebExchangeMatcher(path + "/**", httpMethod);
}
@@ -328,11 +329,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

@@ -362,11 +362,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
@@ -484,6 +491,7 @@ public final class EndpointRequest {
RequestMatcher antPath(RequestMatcherProvider matcherProvider, HttpMethod httpMethod, 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(), httpMethod);