Skip to content

Commit f457071

Browse files
committed
Make Tomcat auto-config back off when UpgradeProtocol is absent
Closes gh-10960
1 parent ad94181 commit f457071

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/ServletWebServerFactoryAutoConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import io.undertow.Undertow;
2323
import org.apache.catalina.startup.Tomcat;
24+
import org.apache.coyote.UpgradeProtocol;
2425
import org.eclipse.jetty.server.Server;
2526
import org.eclipse.jetty.util.Loader;
2627
import org.eclipse.jetty.webapp.WebAppContext;
@@ -84,7 +85,7 @@ public DefaultServletWebServerFactoryCustomizer serverPropertiesWebServerFactory
8485
* Nested configuration if Tomcat is being used.
8586
*/
8687
@Configuration
87-
@ConditionalOnClass({ Servlet.class, Tomcat.class })
88+
@ConditionalOnClass({ Servlet.class, Tomcat.class, UpgradeProtocol.class })
8889
@ConditionalOnMissingBean(value = ServletWebServerFactory.class, search = SearchStrategy.CURRENT)
8990
public static class EmbeddedTomcat {
9091

0 commit comments

Comments
 (0)