-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot 3: ResponseStatusException does not work #33934
Comments
By default Spring Boot 3.0 also applies security to error dispatches. In your example, the Try adding:
to your configuration. |
@philwebb nice. It works. Thanks! |
@xuan-nguyen-swe The reason why One thing to note is that, adding |
Download generated code from https://start.spring.io
Replace content of
DemoApplication.kt
with the following codehttp://localhost:8080/public-api/hello?error=true
returns "403 Forbidden"build.gradle.kts
, changeid("org.springframework.boot") version "3.0.2"
toid("org.springframework.boot") version "2.7.8"
DemoApplication.kt
, changerequestMatchers("/public-api/**")
toantMatchers("/public-api/**")
becauserequestMatchers
is not available in Spring Boot 2.http://localhost:8080/public-api/hello?error=true
returns "400 Bad Request" with bodyThe text was updated successfully, but these errors were encountered: