|
|
|
|
@ -130,6 +130,7 @@ class ServerPropertiesTests {
@@ -130,6 +130,7 @@ class ServerPropertiesTests {
|
|
|
|
|
map.put("server.tomcat.remoteip.protocol-header", "X-Forwarded-Protocol"); |
|
|
|
|
map.put("server.tomcat.remoteip.remote-ip-header", "Remote-Ip"); |
|
|
|
|
map.put("server.tomcat.remoteip.internal-proxies", "10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"); |
|
|
|
|
map.put("server.tomcat.reject-illegal-header", "false"); |
|
|
|
|
map.put("server.tomcat.background-processor-delay", "10"); |
|
|
|
|
map.put("server.tomcat.relaxed-path-chars", "|,<"); |
|
|
|
|
map.put("server.tomcat.relaxed-query-chars", "^ , | "); |
|
|
|
|
@ -152,6 +153,7 @@ class ServerPropertiesTests {
@@ -152,6 +153,7 @@ class ServerPropertiesTests {
|
|
|
|
|
assertThat(tomcat.getRemoteip().getRemoteIpHeader()).isEqualTo("Remote-Ip"); |
|
|
|
|
assertThat(tomcat.getRemoteip().getProtocolHeader()).isEqualTo("X-Forwarded-Protocol"); |
|
|
|
|
assertThat(tomcat.getRemoteip().getInternalProxies()).isEqualTo("10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"); |
|
|
|
|
assertThat(tomcat.isRejectIllegalHeader()).isFalse(); |
|
|
|
|
assertThat(tomcat.getBackgroundProcessorDelay()).hasSeconds(10); |
|
|
|
|
assertThat(tomcat.getRelaxedPathChars()).containsExactly('|', '<'); |
|
|
|
|
assertThat(tomcat.getRelaxedQueryChars()).containsExactly('^', '|'); |
|
|
|
|
@ -405,6 +407,12 @@ class ServerPropertiesTests {
@@ -405,6 +407,12 @@ class ServerPropertiesTests {
|
|
|
|
|
.isEqualTo(new RemoteIpValve().getInternalProxies()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void tomcatRejectIllegalHeaderMatchesProtocolDefault() throws Exception { |
|
|
|
|
assertThat(getDefaultProtocol()).hasFieldOrPropertyWithValue("rejectIllegalHeader", |
|
|
|
|
this.properties.getTomcat().isRejectIllegalHeader()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void tomcatUseRelativeRedirectsDefaultsToFalse() { |
|
|
|
|
assertThat(this.properties.getTomcat().isUseRelativeRedirects()).isFalse(); |
|
|
|
|
|