Check both https and wss in forwarded header checks
Closes gh-27097
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -239,7 +239,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
|
||||
int port = uriComponents.getPort();
|
||||
|
||||
this.scheme = uriComponents.getScheme();
|
||||
this.secure = "https".equals(this.scheme);
|
||||
this.secure = "https".equals(this.scheme) || "wss".equals(this.scheme);
|
||||
this.host = uriComponents.getHost();
|
||||
this.port = (port == -1 ? (this.secure ? 443 : 80) : port);
|
||||
|
||||
|
||||
@@ -882,7 +882,7 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
|
||||
}
|
||||
|
||||
if (this.scheme != null && ((this.scheme.equals("http") && "80".equals(this.port)) ||
|
||||
(this.scheme.equals("https") && "443".equals(this.port)))) {
|
||||
((this.scheme.equals("https") || this.scheme.equals("wss")) && "443".equals(this.port)))) {
|
||||
port(null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user