Skip to content

Commit 3726d6e

Browse files
committed
Align proxies with defaults from Tomcat 10.1.40
See gh-45071
1 parent 9dc1e3e commit 3726d6e

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

10431046
/**
10441047
* 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)