Merge branch '1.5.x'

This commit is contained in:
Stephane Nicoll
2017-04-10 11:15:33 +02:00
2 changed files with 19 additions and 1 deletions

View File

@@ -236,7 +236,7 @@ public class DefaultServletWebServerFactoryCustomizer
if (maxHttpHeaderSize > 0) {
customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize);
}
if (tomcatProperties.getMaxHttpPostSize() > 0) {
if (tomcatProperties.getMaxHttpPostSize() != 0) {
customizeMaxHttpPostSize(factory, tomcatProperties.getMaxHttpPostSize());
}
if (tomcatProperties.getAccesslog().isEnabled()) {

View File

@@ -396,6 +396,24 @@ public class DefaultServletWebServerFactoryCustomizerTests {
}
}
@Test
public void customTomcatDisableMaxHttpPostSize() {
Map<String, String> map = new HashMap<String, String>();
map.put("server.tomcat.max-http-post-size", "-1");
bindProperties(map);
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
this.customizer.customize(factory);
TomcatWebServer embeddedFactory = (TomcatWebServer) factory.getWebServer();
embeddedFactory.start();
try {
assertThat(embeddedFactory.getTomcat().getConnector().getMaxPostSize())
.isEqualTo(-1);
}
finally {
embeddedFactory.stop();
}
}
@Test
public void customizeUndertowAccessLog() {
Map<String, String> map = new HashMap<>();