|
|
|
@ -182,6 +182,19 @@ class TomcatWebServerFactoryCustomizerTests {
|
|
|
|
|
.getMaxHttpHeaderSize()).isEqualTo(DataSize.ofKilobytes(1).toBytes()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void customMaxHttpHeaderSizeWithHttp2() {
|
|
|
|
|
bind("server.max-http-header-size=1KB", "server.http2.enabled=true");
|
|
|
|
|
customizeAndRunServer((server) -> {
|
|
|
|
|
AbstractHttp11Protocol<?> protocolHandler = (AbstractHttp11Protocol<?>) server.getTomcat().getConnector()
|
|
|
|
|
.getProtocolHandler();
|
|
|
|
|
long expectedSize = DataSize.ofKilobytes(1).toBytes();
|
|
|
|
|
assertThat(protocolHandler.getMaxHttpHeaderSize()).isEqualTo(expectedSize);
|
|
|
|
|
assertThat(((Http2Protocol) protocolHandler.getUpgradeProtocol("h2c")).getMaxHeaderSize())
|
|
|
|
|
.isEqualTo(expectedSize);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void customMaxHttpHeaderSizeIgnoredIfNegative() {
|
|
|
|
|
bind("server.max-http-header-size=-1");
|
|
|
|
|