|
|
@ -82,9 +82,9 @@ public class JettyWebServerFactoryCustomizer
|
|
|
|
PropertyMapper propertyMapper = PropertyMapper.get();
|
|
|
|
PropertyMapper propertyMapper = PropertyMapper.get();
|
|
|
|
propertyMapper.from(threadProperties::getAcceptors).whenNonNull().to(factory::setAcceptors);
|
|
|
|
propertyMapper.from(threadProperties::getAcceptors).whenNonNull().to(factory::setAcceptors);
|
|
|
|
propertyMapper.from(threadProperties::getSelectors).whenNonNull().to(factory::setSelectors);
|
|
|
|
propertyMapper.from(threadProperties::getSelectors).whenNonNull().to(factory::setSelectors);
|
|
|
|
propertyMapper.from(properties::getMaxHttpHeaderSize).whenNonNull().asInt(DataSize::toBytes)
|
|
|
|
propertyMapper.from(properties::getMaxHttpRequestHeaderSize).whenNonNull().asInt(DataSize::toBytes)
|
|
|
|
.when(this::isPositive).to((maxHttpHeaderSize) -> factory
|
|
|
|
.when(this::isPositive).to((maxHttpRequestHeaderSize) -> factory
|
|
|
|
.addServerCustomizers(new MaxHttpHeaderSizeCustomizer(maxHttpHeaderSize)));
|
|
|
|
.addServerCustomizers(new MaxHttpRequestHeaderSizeCustomizer(maxHttpRequestHeaderSize)));
|
|
|
|
propertyMapper.from(jettyProperties::getMaxHttpFormPostSize).asInt(DataSize::toBytes).when(this::isPositive)
|
|
|
|
propertyMapper.from(jettyProperties::getMaxHttpFormPostSize).asInt(DataSize::toBytes).when(this::isPositive)
|
|
|
|
.to((maxHttpFormPostSize) -> customizeMaxHttpFormPostSize(factory, maxHttpFormPostSize));
|
|
|
|
.to((maxHttpFormPostSize) -> customizeMaxHttpFormPostSize(factory, maxHttpFormPostSize));
|
|
|
|
propertyMapper.from(jettyProperties::getConnectionIdleTimeout).whenNonNull()
|
|
|
|
propertyMapper.from(jettyProperties::getConnectionIdleTimeout).whenNonNull()
|
|
|
@ -192,12 +192,12 @@ public class JettyWebServerFactoryCustomizer
|
|
|
|
return CustomRequestLog.NCSA_FORMAT;
|
|
|
|
return CustomRequestLog.NCSA_FORMAT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static class MaxHttpHeaderSizeCustomizer implements JettyServerCustomizer {
|
|
|
|
private static class MaxHttpRequestHeaderSizeCustomizer implements JettyServerCustomizer {
|
|
|
|
|
|
|
|
|
|
|
|
private final int maxHttpHeaderSize;
|
|
|
|
private final int maxRequestHeaderSize;
|
|
|
|
|
|
|
|
|
|
|
|
MaxHttpHeaderSizeCustomizer(int maxHttpHeaderSize) {
|
|
|
|
MaxHttpRequestHeaderSizeCustomizer(int maxRequestHeaderSize) {
|
|
|
|
this.maxHttpHeaderSize = maxHttpHeaderSize;
|
|
|
|
this.maxRequestHeaderSize = maxRequestHeaderSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -212,7 +212,7 @@ public class JettyWebServerFactoryCustomizer
|
|
|
|
private void customize(ConnectionFactory factory) {
|
|
|
|
private void customize(ConnectionFactory factory) {
|
|
|
|
if (factory instanceof HttpConfiguration.ConnectionFactory) {
|
|
|
|
if (factory instanceof HttpConfiguration.ConnectionFactory) {
|
|
|
|
((HttpConfiguration.ConnectionFactory) factory).getHttpConfiguration()
|
|
|
|
((HttpConfiguration.ConnectionFactory) factory).getHttpConfiguration()
|
|
|
|
.setRequestHeaderSize(this.maxHttpHeaderSize);
|
|
|
|
.setRequestHeaderSize(this.maxRequestHeaderSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|