spring-boot/spring-boot-project
Andy Wilkinson 6353603d63 Avoid exposing Jetty's WebSocketUpgradeFilter as a bean
When the filter is exposed as a bean (directly or through a
registration bean), it's picked up by the auto-configuration of
MockMvc. This causes a problem as MockMvc does not call init on a
filter before it's used and WebSocketUpgradeFilter fails with a
NullPointerException if its doFilter method is called when its init
method has not been called.

This commit reworks the WebSocket auto-configuration to use a
ServletContextInitalizer to register WebSocketUpgradeFilter rather
than a FilterRegistrationBean. This ensure that the filter is still
registered at the required position in the chain (last filter before
the servlet) while also preventing it from being registered with the
auto-configured MockMvc in tests.

Closes gh-37660
2023-10-03 16:13:24 +01:00
..
spring-boot Merge branch '2.7.x' into 3.0.x 2023-10-03 10:28:51 +01:00
spring-boot-actuator
spring-boot-actuator-autoconfigure Merge branch '2.7.x' into 3.0.x 2023-10-03 10:28:51 +01:00
spring-boot-autoconfigure Avoid exposing Jetty's WebSocketUpgradeFilter as a bean 2023-10-03 16:13:24 +01:00
spring-boot-dependencies Merge branch '2.7.x' into 3.0.x 2023-09-22 16:21:41 +01:00
spring-boot-devtools Merge branch '2.7.x' into 3.0.x 2023-10-03 10:28:51 +01:00
spring-boot-docs Merge branch '2.7.x' into 3.0.x 2023-09-28 08:51:12 +02:00
spring-boot-parent
spring-boot-starters Update README.adoc to add Oracle Spring Boot Starters 2023-09-15 13:37:20 +01:00
spring-boot-test
spring-boot-test-autoconfigure Merge branch '2.7.x' into 3.0.x 2023-09-20 17:06:55 -07:00
spring-boot-tools Merge branch '2.7.x' into 3.0.x 2023-10-03 10:28:51 +01:00