Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2e86a6f4
Commit
2e86a6f4
authored
Sep 11, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x' into 2.0.x
parents
9b1e74b2
0bd7c8af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+3
-2
ServerPropertiesTests.java
...amework/boot/autoconfigure/web/ServerPropertiesTests.java
+7
-0
TomcatWebServerFactoryCustomizerTests.java
...e/web/embedded/TomcatWebServerFactoryCustomizerTests.java
+2
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
2e86a6f4
...
@@ -372,7 +372,7 @@ public class ServerProperties {
...
@@ -372,7 +372,7 @@ public class ServerProperties {
private
final
Accesslog
accesslog
=
new
Accesslog
();
private
final
Accesslog
accesslog
=
new
Accesslog
();
/**
/**
* Regular expression
matching trusted IP addresses
.
* Regular expression
that matches proxies that are to be trusted
.
*/
*/
private
String
internalProxies
=
"10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|"
// 10/8
private
String
internalProxies
=
"10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|"
// 10/8
+
"192\\.168\\.\\d{1,3}\\.\\d{1,3}|"
// 192.168/16
+
"192\\.168\\.\\d{1,3}\\.\\d{1,3}|"
// 192.168/16
...
@@ -380,7 +380,8 @@ public class ServerProperties {
...
@@ -380,7 +380,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".
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java
View file @
2e86a6f4
...
@@ -37,6 +37,7 @@ import org.apache.catalina.connector.Connector;
...
@@ -37,6 +37,7 @@ import org.apache.catalina.connector.Connector;
import
org.apache.catalina.core.StandardContext
;
import
org.apache.catalina.core.StandardContext
;
import
org.apache.catalina.core.StandardEngine
;
import
org.apache.catalina.core.StandardEngine
;
import
org.apache.catalina.valves.AccessLogValve
;
import
org.apache.catalina.valves.AccessLogValve
;
import
org.apache.catalina.valves.RemoteIpValve
;
import
org.apache.coyote.AbstractProtocol
;
import
org.apache.coyote.AbstractProtocol
;
import
org.eclipse.jetty.server.HttpChannel
;
import
org.eclipse.jetty.server.HttpChannel
;
import
org.eclipse.jetty.server.Request
;
import
org.eclipse.jetty.server.Request
;
...
@@ -267,6 +268,12 @@ public class ServerPropertiesTests {
...
@@ -267,6 +268,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
{
JettyServletWebServerFactory
jettyFactory
=
new
JettyServletWebServerFactory
(
0
);
JettyServletWebServerFactory
jettyFactory
=
new
JettyServletWebServerFactory
(
0
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java
View file @
2e86a6f4
...
@@ -167,7 +167,8 @@ public class TomcatWebServerFactoryCustomizerTests {
...
@@ -167,7 +167,8 @@ public class TomcatWebServerFactoryCustomizerTests {
+
"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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment