mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
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 |
||
---|---|---|
.. | ||
spring-boot | ||
spring-boot-actuator | ||
spring-boot-actuator-autoconfigure | ||
spring-boot-autoconfigure | ||
spring-boot-dependencies | ||
spring-boot-devtools | ||
spring-boot-docs | ||
spring-boot-parent | ||
spring-boot-starters | ||
spring-boot-test | ||
spring-boot-test-autoconfigure | ||
spring-boot-tools |