Skip to content

Remove code to set the ServletResponse contentType and characterEncoding properties from the "Content-Type" header #36352

@rstoyanchev

Description

@rstoyanchev

Spring MVC generally works with the "Content-Type" header of the response rather than the contentType and characterEncoding properties of ServletResponse.

This is typically done through the HttpHeaders of ServletServerHttpResponse, and then merged into the ServletResponse headers, but as of #36334, we now use ServletResponseHeadersAdapter to map HttpHeaders opertions directly onto ServletResponse header methods.

As mentioned in #36343, Spring MVC has several places where it propagates the "Content-Type" header to the contentType and characterEncoding properties of ServletResponse. This shouldn't be necessary, but it remains in 7.0.x to avoid side effects. Going forward, we can remove it In the next minor version 7.1.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions