use of org.apache.coyote.http11.AbstractHttp11Protocol in project spring-boot by spring-projects.
the class CompressionConnectorCustomizerTests method shouldCustomizeCompression.
@Test
void shouldCustomizeCompression() throws LifecycleException {
CompressionConnectorCustomizer compressionConnectorCustomizer = new CompressionConnectorCustomizer(this.compression);
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
Http2Protocol upgradeProtocol = new Http2Protocol();
upgradeProtocol.setHttp11Protocol((AbstractHttp11Protocol<?>) connector.getProtocolHandler());
connector.addUpgradeProtocol(upgradeProtocol);
compressionConnectorCustomizer.customize(connector);
AbstractHttp11Protocol<?> abstractHttp11Protocol = (AbstractHttp11Protocol<?>) connector.getProtocolHandler();
compressionOn(abstractHttp11Protocol.getCompression());
minSize(abstractHttp11Protocol.getCompressionMinSize());
mimeType(abstractHttp11Protocol.getCompressibleMimeTypes());
excludedUserAgents(abstractHttp11Protocol.getNoCompressionUserAgents());
}
use of org.apache.coyote.http11.AbstractHttp11Protocol in project spring-boot by spring-projects.
the class TomcatWebServerFactoryCustomizer method customizeMaxKeepAliveRequests.
private void customizeMaxKeepAliveRequests(ConfigurableTomcatWebServerFactory factory, int maxKeepAliveRequests) {
factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractHttp11Protocol) {
AbstractHttp11Protocol<?> protocol = (AbstractHttp11Protocol<?>) handler;
protocol.setMaxKeepAliveRequests(maxKeepAliveRequests);
}
});
}
use of org.apache.coyote.http11.AbstractHttp11Protocol in project spring-boot by spring-projects.
the class TomcatWebServerFactoryCustomizer method customizeMaxSwallowSize.
private void customizeMaxSwallowSize(ConfigurableTomcatWebServerFactory factory, int maxSwallowSize) {
factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractHttp11Protocol) {
AbstractHttp11Protocol<?> protocol = (AbstractHttp11Protocol<?>) handler;
protocol.setMaxSwallowSize(maxSwallowSize);
}
});
}
use of org.apache.coyote.http11.AbstractHttp11Protocol in project spring-boot by spring-projects.
the class TomcatWebServerFactoryCustomizer method customizeMaxHttpHeaderSize.
@SuppressWarnings("rawtypes")
private void customizeMaxHttpHeaderSize(ConfigurableTomcatWebServerFactory factory, int maxHttpHeaderSize) {
factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractHttp11Protocol) {
AbstractHttp11Protocol protocol = (AbstractHttp11Protocol) handler;
protocol.setMaxHttpHeaderSize(maxHttpHeaderSize);
}
});
}
use of org.apache.coyote.http11.AbstractHttp11Protocol in project spring-boot by spring-projects.
the class TomcatWebServerFactoryCustomizer method customizeRejectIllegalHeader.
private void customizeRejectIllegalHeader(ConfigurableTomcatWebServerFactory factory, boolean rejectIllegalHeader) {
factory.addConnectorCustomizers((connector) -> {
ProtocolHandler handler = connector.getProtocolHandler();
if (handler instanceof AbstractHttp11Protocol) {
AbstractHttp11Protocol<?> protocol = (AbstractHttp11Protocol<?>) handler;
protocol.setRejectIllegalHeader(rejectIllegalHeader);
}
});
}
Aggregations