mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-29 07:12:32 +00:00
Readability Polish
Heavily nested parentheses and lots of indentation can get hard to read, so we should simplify this where we can. Issue: gh-6639
This commit is contained in:
parent
281ccff907
commit
2daed8c003
@ -102,9 +102,10 @@ public final class HttpsRedirectWebFilter implements WebFilter {
|
|||||||
UriComponentsBuilder.fromUri(exchange.getRequest().getURI());
|
UriComponentsBuilder.fromUri(exchange.getRequest().getURI());
|
||||||
|
|
||||||
if (port > 0) {
|
if (port > 0) {
|
||||||
builder.port(Optional.ofNullable(this.portMapper.lookupHttpsPort(port))
|
Optional.ofNullable(this.portMapper.lookupHttpsPort(port))
|
||||||
|
.map(builder::port)
|
||||||
.orElseThrow(() -> new IllegalStateException(
|
.orElseThrow(() -> new IllegalStateException(
|
||||||
"HTTP Port '" + port + "' does not have a corresponding HTTPS Port")));
|
"HTTP Port '" + port + "' does not have a corresponding HTTPS Port"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder.scheme("https").build().toUri();
|
return builder.scheme("https").build().toUri();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user