Skip to content

Commit 973f961

Browse files
committed
Align proxies with defaults from Tomcat 10.1.40
See gh-45128
1 parent 1046c46 commit 973f961

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,10 @@ public static class Remoteip {
10471047
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
10481048
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
10491049
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
1050-
+ "0:0:0:0:0:0:0:1|::1";
1050+
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
1051+
+ "::1|" // ::1
1052+
+ "fe[89ab]\\p{XDigit}:.*|" //
1053+
+ "f[cd]\\p{XDigit}{2}+:.*";
10511054

10521055
/**
10531056
* Header that holds the incoming protocol, usually named "X-Forwarded-Proto".

Diff for: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ private void testRemoteIpValveConfigured() {
386386
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
387387
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
388388
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
389-
+ "0:0:0:0:0:0:0:1|::1";
389+
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
390+
+ "::1|" // ::1
391+
+ "fe[89ab]\\p{XDigit}:.*|" //
392+
+ "f[cd]\\p{XDigit}{2}+:.*";
390393
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
391394
}
392395

0 commit comments

Comments
 (0)