Align server.tomcat.internal-proxies default with RemoteIPValve's default
Closes gh-13798
This commit is contained in:
@@ -610,7 +610,8 @@ public class ServerProperties
|
||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
|
||||
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|"
|
||||
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}";
|
||||
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "0:0:0:0:0:0:0:1|::1";
|
||||
|
||||
/**
|
||||
* Header that holds the incoming protocol, usually named "X-Forwarded-Proto".
|
||||
|
||||
@@ -579,7 +579,8 @@ public class ServerPropertiesTests {
|
||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
|
||||
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
|
||||
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|"
|
||||
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}";
|
||||
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" //
|
||||
+ "0:0:0:0:0:0:0:1|::1";
|
||||
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
|
||||
}
|
||||
|
||||
@@ -896,6 +897,12 @@ public class ServerPropertiesTests {
|
||||
.isEqualTo(new AccessLogValve().getRequestAttributesEnabled());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tomcatInternalProxiesMatchesDefault() {
|
||||
assertThat(this.properties.getTomcat().getInternalProxies())
|
||||
.isEqualTo(new RemoteIpValve().getInternalProxies());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jettyMaxHttpPostSizeMatchesDefault() throws Exception {
|
||||
JettyEmbeddedServletContainerFactory jettyFactory = new JettyEmbeddedServletContainerFactory(
|
||||
|
||||
Reference in New Issue
Block a user