Merge branch '2.2.x'

Closes gh-19422
This commit is contained in:
Andy Wilkinson
2019-12-20 15:55:16 +00:00

View File

@@ -187,7 +187,13 @@ public class TomcatWebServerFactoryCustomizer
// The internal proxies default to a white list of "safe" internal IP
// addresses
valve.setInternalProxies(remoteIpProperties.getInternalProxies());
valve.setHostHeader(remoteIpProperties.getHostHeader());
try {
valve.setHostHeader(tomcatProperties.getHostHeader());
}
catch (NoSuchMethodError ex) {
// Avoid failure with war deployments to Tomcat 8.5 before 8.5.44 and
// Tomcat 9 before 9.0.23
}
valve.setPortHeader(remoteIpProperties.getPortHeader());
valve.setProtocolHeaderHttpsValue(remoteIpProperties.getProtocolHeaderHttpsValue());
// ... so it's safe to add this valve by default.