Issue #5443 - Forwarding Headers are optional

+ Simplify isSecure handling in customize.
+ Simplify handling of `Proxy-Ssl-Id` header.
+ Simplify handling of `Proxy-auth-cert` header.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2020-10-13 07:03:37 -05:00
parent 0b646ee6b7
commit f0681b33eb
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 4 additions and 12 deletions

View File

@ -481,13 +481,12 @@ public class ForwardedRequestCustomizer implements Customizer
if (match)
{
String proto = "http";
String proto;
// Is secure status configured from headers?
if (forwarded.isSecure())
{
// set default to https
proto = config.getSecureScheme();
request.setSecure(true);
}
// Set Scheme from configured protocol
@ -528,15 +527,6 @@ public class ForwardedRequestCustomizer implements Customizer
request.setAuthority(host, port);
}
// Set secure status
if (forwarded.isSecure() ||
proto.equalsIgnoreCase(config.getSecureScheme()) ||
port == getSecurePort(config))
{
request.setSecure(true);
request.setScheme(proto);
}
// Set Remote Address
if (forwarded.hasFor())
{
@ -801,6 +791,7 @@ public class ForwardedRequestCustomizer implements Customizer
if (isSslIsSecure())
{
_secure = true;
_proto = "https";
}
}
@ -811,6 +802,7 @@ public class ForwardedRequestCustomizer implements Customizer
if (isSslIsSecure())
{
_secure = true;
_proto = "https";
}
}