Remove Content-Length response header before delegating to WebExceptionHandlers [SPR-17502] #22034
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Brian Clozel opened SPR-17502 and commented
Given the following controller in Spring WebFlux:
When this handler is used, the thrown exception is being handled by the
WebExceptionHandlers
configured instances. At that point, the response might be committed or not.When used in Spring Boot, this will cause HTTP clients to partially read the actual error response (JSON or HTML), since those are written in chunked encoding mode. Also, other encoders will opt out and won't override any existing
"Content-Length"
header.We should (in
ExceptionHandlingWebHandler
?) make sure that we try and remove the"Content-Length"
response header as the error response won't be of the same length.Affects: 5.0.10, 5.1.2
Referenced from: commits 617b94a, 3203d39, 5342c6e
Backported to: 5.0.11
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: