Skip to content

Commit c3e0e1b

Browse files
committed
Upgrade to Tomcat 11.0.13
Closes gh-47589
1 parent 1c79779 commit c3e0e1b

3 files changed

Lines changed: 8 additions & 33 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ nativeBuildToolsVersion=0.11.1
2222
snakeYamlVersion=2.5
2323
springFrameworkVersion=7.0.0-SNAPSHOT
2424
springFramework60xVersion=6.0.23
25-
tomcatVersion=11.0.11
25+
tomcatVersion=11.0.13
2626
nullabilityPluginVersion=0.0.5
2727

2828
kotlin.stdlib.default.dependency=false

module/spring-boot-tomcat/src/main/java/org/springframework/boot/tomcat/autoconfigure/TomcatServerProperties.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -750,23 +750,11 @@ public void setEnabled(boolean enabled) {
750750
public static class Remoteip {
751751

752752
/**
753-
* Regular expression that matches proxies that are to be trusted.
754-
*/
755-
private String internalProxies = "10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 10/8
756-
+ "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" // 192.168/16
757-
+ "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16
758-
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
759-
+ "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
760-
+ "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
761-
+ "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
762-
+ "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
763-
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
764-
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
765-
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
766-
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
767-
+ "::1|" // ::1
768-
+ "fe[89ab]\\p{XDigit}:.*|" //
769-
+ "f[cd]\\p{XDigit}{2}+:.*";
753+
* Internal proxies that are to be trusted. Can be set as a comma separate list of
754+
* CIDR or as a regular expression.
755+
*/
756+
private String internalProxies = "192.168.0.0/16, 172.16.0.0/12, 169.254.0.0/16, fc00::/7, "
757+
+ "10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, fe80::/10, ::1/128";
770758

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

module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatWebServerFactoryCustomizerTests.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -436,21 +436,8 @@ private void testRemoteIpValveConfigured() {
436436
assertThat(remoteIpValve.getRemoteIpHeader()).isEqualTo("X-Forwarded-For");
437437
assertThat(remoteIpValve.getHostHeader()).isEqualTo("X-Forwarded-Host");
438438
assertThat(remoteIpValve.getPortHeader()).isEqualTo("X-Forwarded-Port");
439-
String expectedInternalProxies = "10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 10/8
440-
+ "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" // 192.168/16
441-
+ "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16
442-
+ "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8
443-
+ "100\\.6[4-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
444-
+ "100\\.[7-9]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
445-
+ "100\\.1[0-1]{1}\\d{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
446-
+ "100\\.12[0-7]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 100.64.0.0/10
447-
+ "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
448-
+ "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
449-
+ "172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12
450-
+ "0:0:0:0:0:0:0:1|" // 0:0:0:0:0:0:0:1
451-
+ "::1|" // ::1
452-
+ "fe[89ab]\\p{XDigit}:.*|" //
453-
+ "f[cd]\\p{XDigit}{2}+:.*";
439+
String expectedInternalProxies = "192.168.0.0/16, 172.16.0.0/12, 169.254.0.0/16, fc00::/7, 10.0.0.0/8, "
440+
+ "100.64.0.0/10, 127.0.0.0/8, fe80::/10, ::1/128";
454441
assertThat(remoteIpValve.getInternalProxies()).isEqualTo(expectedInternalProxies);
455442
}
456443

0 commit comments

Comments
 (0)