Allow the tomcat maxHttpHeaderSize to be changed in external config

Prevents large SPNEGO headers from causing server errors for example.
Added the property to ServerProperties.

Fixes gh-931
This commit is contained in:
apoplexy
2014-05-22 11:33:10 +01:00
committed by Dave Syer
parent 0e2f9e74db
commit dfc1979ea2
2 changed files with 35 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ import static org.mockito.Mockito.verify;
/**
* Tests for {@link ServerProperties}.
*
*
* @author Dave Syer
* @author Stephane Nicoll
*/
@@ -97,4 +97,13 @@ public class ServerPropertiesTests {
assertEquals("US-ASCII", this.properties.getTomcat().getUriEncoding());
}
@Test
public void testCustomizeTomcatHeaderSize() throws Exception {
Map<String, String> map = new HashMap<String, String>();
map.put("server.tomcat.maxHttpHeaderSize", "9999");
new RelaxedDataBinder(this.properties, "server").bind(new MutablePropertyValues(
map));
assertEquals(9999, this.properties.getTomcat().getMaxHttpHeaderSize());
}
}