-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix
Description
We upgrade our applications from Spring Boot 1.5.19.RELEASE to 1.5.20.RELEASE, and found the customized error controller is broken in this release because of Tomcat upgrade.
Tomcat 8.5.39 introduces a regression, apache/tomcat@d30d3e3#diff-95185e588de3604778aaae00c0afdf10. Now org.apache.coyote.Response.setStatus
method will check previous status code and don't overwrite if the previous status is larger than 399.
public void setStatus(int status) {
if (this.status > 399) {
// Don't overwrite first recorded error status
return;
}
this.status = status;
}
This causes problem for Spring Boot. For example, DefaultHandlerExceptionResolver may set the status to 400 for MissingServletRequestParameterException. But in our customized error controller, if we set the status to something else, the new status will be silently ignored.
Metadata
Metadata
Assignees
Labels
for: external-projectFor an external project and not something we can fixFor an external project and not something we can fix