|
|
@ -51,6 +51,7 @@ import org.springframework.util.unit.DataSize;
|
|
|
|
* @author Artsiom Yudovin
|
|
|
|
* @author Artsiom Yudovin
|
|
|
|
* @author Chentao Qu
|
|
|
|
* @author Chentao Qu
|
|
|
|
* @author Andrew McGhie
|
|
|
|
* @author Andrew McGhie
|
|
|
|
|
|
|
|
* @author Dirk Deyne
|
|
|
|
* @since 2.0.0
|
|
|
|
* @since 2.0.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class TomcatWebServerFactoryCustomizer
|
|
|
|
public class TomcatWebServerFactoryCustomizer
|
|
|
@ -102,6 +103,10 @@ public class TomcatWebServerFactoryCustomizer
|
|
|
|
.to((acceptCount) -> customizeAcceptCount(factory, acceptCount));
|
|
|
|
.to((acceptCount) -> customizeAcceptCount(factory, acceptCount));
|
|
|
|
propertyMapper.from(tomcatProperties::getProcessorCache)
|
|
|
|
propertyMapper.from(tomcatProperties::getProcessorCache)
|
|
|
|
.to((processorCache) -> customizeProcessorCache(factory, processorCache));
|
|
|
|
.to((processorCache) -> customizeProcessorCache(factory, processorCache));
|
|
|
|
|
|
|
|
propertyMapper.from(tomcatProperties::getRelaxedQueryChars)
|
|
|
|
|
|
|
|
.to((relaxedChars) -> customizeRelaxedQueryChars(factory, relaxedChars));
|
|
|
|
|
|
|
|
propertyMapper.from(tomcatProperties::getRelaxedPathChars)
|
|
|
|
|
|
|
|
.to((relaxedChars) -> customizeRelaxedPathChars(factory, relaxedChars));
|
|
|
|
customizeStaticResources(factory);
|
|
|
|
customizeStaticResources(factory);
|
|
|
|
customizeErrorReportValve(properties.getError(), factory);
|
|
|
|
customizeErrorReportValve(properties.getError(), factory);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -149,6 +154,14 @@ public class TomcatWebServerFactoryCustomizer
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void customizeRelaxedQueryChars(ConfigurableTomcatWebServerFactory factory, String relaxedChars) {
|
|
|
|
|
|
|
|
factory.addConnectorCustomizers((connector) -> connector.setAttribute("relaxedQueryChars", relaxedChars));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void customizeRelaxedPathChars(ConfigurableTomcatWebServerFactory factory, String relaxedChars) {
|
|
|
|
|
|
|
|
factory.addConnectorCustomizers((connector) -> connector.setAttribute("relaxedPathChars", relaxedChars));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void customizeRemoteIpValve(ConfigurableTomcatWebServerFactory factory) {
|
|
|
|
private void customizeRemoteIpValve(ConfigurableTomcatWebServerFactory factory) {
|
|
|
|
Tomcat tomcatProperties = this.serverProperties.getTomcat();
|
|
|
|
Tomcat tomcatProperties = this.serverProperties.getTomcat();
|
|
|
|
String protocolHeader = tomcatProperties.getProtocolHeader();
|
|
|
|
String protocolHeader = tomcatProperties.getProtocolHeader();
|
|
|
|