You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
1 year ago
..
spring-boot Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-actuator Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-actuator-autoconfigure Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-autoconfigure Avoid exposing Jetty's WebSocketUpgradeFilter as a bean 1 year ago
spring-boot-dependencies Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-devtools Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-docs Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-parent Upgrade to Testcontainers 1.18.3 1 year ago
spring-boot-starters Update README.adoc to add Oracle Spring Boot Starters 1 year ago
spring-boot-test Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-test-autoconfigure Merge branch '2.7.x' into 3.0.x 1 year ago
spring-boot-tools Merge branch '2.7.x' into 3.0.x 1 year ago