spring-framework/spring-web/src
Sam Brannen e4b9b1fadb Introduce setDefaultCharacterEncoding() in MockHttpServletResponse
Prior to this commit, it was possible to set the character encoding
in MockHttpServletResponse via setCharacterEncoding() or
setContentType(); however, those methods append "charset=..." to the
Content-Type header which may not be an acceptable side effect.

This commit addresses this shortcoming by introducing a new
setDefaultCharacterEncoding() in MockHttpServletResponse which allows
one to override the previously hard coded value of "ISO-8859-1". In
addition, setDefaultCharacterEncoding() does not modify the Content-Type
header.

The reset() method has also been updated to reset the character encoding
to the configured default character encoding.

Closes gh-27214
2021-07-29 16:02:58 +02:00
..
jmh/java/org/springframework Merge branch '5.2.x' 2020-10-20 15:41:02 +02:00
main Polishing contribution 2021-07-29 14:49:02 +01:00
test Polishing contribution 2021-07-27 17:41:30 +01:00
testFixtures Introduce setDefaultCharacterEncoding() in MockHttpServletResponse 2021-07-29 16:02:58 +02:00