Skip to content

MockHttpServletResponse reset() does not reset charset field #25501

@Nkyn

Description

@Nkyn

Affects: 5.2.7.RELEASE

When calling the reset() method of MockHttpServletResponse, the boolean charset is not reset to false.
If the response object had the charset set before being reset, charset=null is appended to the mime type.
This can lead to an InvalidMediaTypeException:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is
org.springframework.http.InvalidMediaTypeException: Invalid mime type "application/octet-stream;charset=null": 
unsupported charset 'null'

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulestatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions