Polish 'Fail fast when base path and an endpoint mapping are set to '/''

See gh-45251
This commit is contained in:
Phillip Webb
2025-04-22 11:48:14 -07:00
parent 8f535b266c
commit 7dac8ca345
6 changed files with 81 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,8 @@ class DiscoveredWebEndpoint extends AbstractDiscoveredEndpoint<WebOperation> imp
}
private Stream<String> getAdditionalPaths(WebServerNamespace webServerNamespace, AdditionalPathsMapper mapper) {
return mapper.getAdditionalPaths(getEndpointId(), webServerNamespace).stream();
List<String> additionalPaths = mapper.getAdditionalPaths(getEndpointId(), webServerNamespace);
return (additionalPaths != null) ? additionalPaths.stream() : Stream.empty();
}
}