From 36f01eb40b8a60512288793e748f74044110f25c Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 10 Jun 2022 12:40:40 +0100 Subject: [PATCH] Fix compilation error with Tomcat 10 There's no setter for the max header size in Tomcat 10 as it's now inherited from the underlying HTTP 1.1 protocol. The test that was merged forwards from 2.7.x is retained to verify that this is the case. See gh-31330 --- .../web/embedded/TomcatWebServerFactoryCustomizer.java | 5 ----- 1 file changed, 5 deletions(-) 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 deb41dff14..e53729ab1c 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 @@ -280,11 +280,6 @@ public class TomcatWebServerFactoryCustomizer if (handler instanceof AbstractHttp11Protocol) { AbstractHttp11Protocol protocol = (AbstractHttp11Protocol) handler; protocol.setMaxHttpHeaderSize(maxHttpHeaderSize); - for (UpgradeProtocol upgradeProtocol : protocol.findUpgradeProtocols()) { - if (upgradeProtocol instanceof Http2Protocol) { - ((Http2Protocol) upgradeProtocol).setMaxHeaderSize(maxHttpHeaderSize); - } - } } }); }