-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)
Description
Since Spring 5.2 MediaType.APPLICATION_JSON_UTF8 is @deprecated as described within MediaType class:
/**
* A String equivalent of \{@link MediaType#APPLICATION_JSON_UTF8}.
* @deprecated as of 5.2 in favor of \{@link #APPLICATION_JSON_VALUE}
* since major browsers like Chrome
* <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=438464">
* now comply with the specification</a> and interpret correctly UTF-8 special
* characters without requiring a \{@code charset=UTF-8} parameter.
*/
@Deprecated
public static final String APPLICATION_JSON_UTF8_VALUE = "application/json;charset=UTF-8";So basically everyone should be using MediaType.APPLICATION_JSON_VALUE without (UTF8 information) instead. This is unfortunately in conflict with MockHttpServletResponse:
private String characterEncoding = "ISO-8859-1";So even thought UTF8 is expected by default, the testing environment is in violation with aboves:
now comply with the specification</a> and interpret correctly UTF-8 special
The tests which explicitly don't override this encoding will fail.
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)