-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
ResponseStatusExceptionResolver ignores ResponseStatusException headers #24944
Comments
Support for headers was added recently in #24261 but only on the WebFlux side it seems. |
Correct, this is my observation. I assume this is simply an oversight. |
The provided solution is in consistent with the Flux version: Lines 94 to 97 in ea6d2ea
It does not contain a null check. |
Yes it is a little more defensive. Spring MVC has been around longer and is used more widely. Do you foresee an issue? |
Not right now, but this deserves to be documented. |
This caused random failures in a newly added test. Also remove defensive check in ResponseStatusExceptionResolver. See gh-24944
I've updated it to match WebMvc. |
Affects: Spring Framework 5.2.5.RELEASE
When throwing a derived exception like:
the headers are completely ignored:
It happily ignores the headers:
spring-framework/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/annotation/ResponseStatusExceptionResolver.java
Lines 128 to 133 in 8d31dca
My naive solution seems to work:
The text was updated successfully, but these errors were encountered: