mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Align server.tomcat.internal-proxies default with RemoteIPValve's default
Closes gh-13798
This commit is contained in:
parent
615eeee033
commit
0bd7c8afba
@ -610,7 +610,8 @@ public class ServerProperties
|
|||||||
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
|
+ "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\\.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\\.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".
|
* 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
|
+ "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\\.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\\.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);
|
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -896,6 +897,12 @@ public class ServerPropertiesTests {
|
|||||||
.isEqualTo(new AccessLogValve().getRequestAttributesEnabled());
|
.isEqualTo(new AccessLogValve().getRequestAttributesEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void tomcatInternalProxiesMatchesDefault() {
|
||||||
|
assertThat(this.properties.getTomcat().getInternalProxies())
|
||||||
|
.isEqualTo(new RemoteIpValve().getInternalProxies());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void jettyMaxHttpPostSizeMatchesDefault() throws Exception {
|
public void jettyMaxHttpPostSizeMatchesDefault() throws Exception {
|
||||||
JettyEmbeddedServletContainerFactory jettyFactory = new JettyEmbeddedServletContainerFactory(
|
JettyEmbeddedServletContainerFactory jettyFactory = new JettyEmbeddedServletContainerFactory(
|
||||||
|
@ -212,7 +212,8 @@ content into your application; rather pick only the properties that you need.
|
|||||||
127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\
|
127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\
|
||||||
172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\
|
172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\
|
||||||
172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\
|
172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|\\
|
||||||
172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3} # regular expression matching trusted IP addresses.
|
172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|\\
|
||||||
|
0:0:0:0:0:0:0:1|::1 # Regular expression that matches proxies that are to be trusted.
|
||||||
server.tomcat.max-connections=10000 # Maximum number of connections that the server will accept and process at any given time.
|
server.tomcat.max-connections=10000 # Maximum number of connections that the server will accept and process at any given time.
|
||||||
server.tomcat.max-http-header-size=0 # Maximum size in bytes of the HTTP message header.
|
server.tomcat.max-http-header-size=0 # Maximum size in bytes of the HTTP message header.
|
||||||
server.tomcat.max-http-post-size=2097152 # Maximum size in bytes of the HTTP post content.
|
server.tomcat.max-http-post-size=2097152 # Maximum size in bytes of the HTTP post content.
|
||||||
|
Loading…
Reference in New Issue
Block a user