From 27ee605f9187c9b02802ea746e7c367febc79e01 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 10 Jun 2023 10:08:46 +0200 Subject: [PATCH] Upgrade to Tomcat 10.1.9 Closes gh-35819 --- gradle.properties | 2 +- .../boot/autoconfigure/web/ServerProperties.java | 2 ++ .../web/embedded/TomcatWebServerFactoryCustomizer.java | 1 + .../web/embedded/TomcatWebServerFactoryCustomizerTests.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 19201a9b40..996b28c36f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,6 @@ org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 kotlinVersion=1.8.22 nativeBuildToolsVersion=0.9.22 springFrameworkVersion=6.0.10-SNAPSHOT -tomcatVersion=10.1.8 +tomcatVersion=10.1.9 kotlin.stdlib.default.dependency=false diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 1e8c85f381..a4e5bcf2d1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -475,6 +475,7 @@ public class ServerProperties { /** * Whether to reject requests with illegal header names or values. */ + @Deprecated(since = "2.7.12", forRemoval = true) private boolean rejectIllegalHeader = true; /** @@ -633,6 +634,7 @@ public class ServerProperties { this.connectionTimeout = connectionTimeout; } + @DeprecatedConfigurationProperty(reason = "The setting has been deprecated in Tomcat") public boolean isRejectIllegalHeader() { return this.rejectIllegalHeader; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java index fe4fd09fed..e47b7cccfe 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizer.java @@ -198,6 +198,7 @@ public class TomcatWebServerFactoryCustomizer factory.addConnectorCustomizers((connector) -> connector.setProperty("relaxedQueryChars", relaxedChars)); } + @SuppressWarnings("deprecation") private void customizeRejectIllegalHeader(ConfigurableTomcatWebServerFactory factory, boolean rejectIllegalHeader) { factory.addConnectorCustomizers((connector) -> { ProtocolHandler handler = connector.getProtocolHandler(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java index c4c06168f6..c24b4f179c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/TomcatWebServerFactoryCustomizerTests.java @@ -437,6 +437,7 @@ class TomcatWebServerFactoryCustomizerTests { } @Test + @Deprecated(since = "2.7.12", forRemoval = true) void testCustomizeRejectIllegalHeader() { bind("server.tomcat.reject-illegal-header=false"); customizeAndRunServer((server) -> assertThat(