Skip to content

Remove Content-* response headers before error handling in WebFlux #24238

@bclozel

Description

@bclozel

As a follow up of #22034 and other related issues, we should clear all Content-* response headers in case of errors, if the response is not committed already.

In this case, we need to remove all assumptions about the response that was going to be written when the error happened. WebFlux error handlers may write a very different response body, or not response body at all.

We should then remove the following headers, in AbstractServerHttpResponse:

  • Content-Length (already done in AbstractServerHttpResponse
  • Content-Type (already done in RequestMappingHandlerAdapter, this should move to the response itself)
  • Content-Disposition
  • Content-Encoding
  • Content-Location
  • Content-Language
  • Content-Range

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions