Use 'toString(Charset)' instead of 'toString(String)' for encodings (#27646)
Co-authored-by: 홍성민(SungMin Hong)/Platform Engineering팀/11ST <devmonster@11stcorp.com>
This commit is contained in:
@@ -279,8 +279,11 @@ public class MockHttpServletResponse implements HttpServletResponse {
|
||||
* @see #setContentType(String)
|
||||
*/
|
||||
public String getContentAsString(Charset fallbackCharset) throws UnsupportedEncodingException {
|
||||
String charsetName = (this.characterEncodingSet ? getCharacterEncoding() : fallbackCharset.name());
|
||||
return this.content.toString(charsetName);
|
||||
if (this.characterEncodingSet) {
|
||||
return this.content.toString(getCharacterEncoding());
|
||||
}
|
||||
|
||||
return this.content.toString(fallbackCharset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user