Skip to content

Commit c9b8470

Browse files
committed
Align proxies with defaults from Tomcat 10.1.40
See gh-45084
1 parent 8670c6c commit c9b8470

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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
@@ -1039,7 +1039,10 @@ public static class Remoteip {
10391039
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
10401040
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
10411041
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
1042-
+ "0:0:0:0:0:0:0:1|::1";
1042+
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
1043+
+ "::1|" // ::1
1044+
+ "fe[89ab]\\p{XDigit}:.*|" //
1045+
+ "f[cd]\\p{XDigit}{2}+:.*";
10431046

10441047
/**
10451048
* 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/embedded/TomcatWebServerFactoryCustomizerTests.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,10 @@ private void testRemoteIpValveConfigured() {
379379
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
380380
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
381381
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
382-
+ "0:0:0:0:0:0:0:1|::1";
382+
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
383+
+ "::1|" // ::1
384+
+ "fe[89ab]\\p{XDigit}:.*|" //
385+
+ "f[cd]\\p{XDigit}{2}+:.*";
383386
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
384387
}
385388

0 commit comments

Comments
 (0)