Reset charset field in MockHttpServletResponse

Prior to this commit, calling reset() on MockHttpServletResponse did not
reset the `charset` field to `false` which could result in the
"Content-Type" header containing `;charset=null` which in turn would
result in errors when parsing the "Content-Type" header.

This commit resets the charset field to `false` in
MockHttpServletResponse's reset() method to avoid such errors.

Closes gh-25501
This commit is contained in:
Sam Brannen
2020-08-01 12:47:23 +02:00
parent 785ab5798a
commit 5576321b04
3 changed files with 25 additions and 0 deletions

View File

@@ -331,6 +331,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
public void reset() {
resetBuffer();
this.characterEncoding = null;
this.charset = false;
this.contentLength = 0;
this.contentType = null;
this.locale = Locale.getDefault();