Deprecate MediaType.APPLICATION_JSON_UTF8
This commit deprecates MediaType.APPLICATION_JSON_UTF8 and MediaType.APPLICATION_PROBLEM_JSON_UTF8 in favor of MediaType.APPLICATION_JSON and MediaType.APPLICATION_PROBLEM_JSON since UTF-8 encoding is now handled correctly by most browsers (related bug has been fixed in Chrome since September 2017). MediaType.APPLICATION_JSON is now used as the default JSON content type. Closes gh-22788
This commit is contained in:
@@ -48,11 +48,11 @@ inline fun <reified T : Any> ServerResponse.BodyBuilder.bodyToServerSentEvents(p
|
||||
contentType(MediaType.TEXT_EVENT_STREAM).body(publisher, object : ParameterizedTypeReference<T>() {})
|
||||
|
||||
/**
|
||||
* Shortcut for setting [MediaType.APPLICATION_JSON_UTF8] `Content-Type` header.
|
||||
* Shortcut for setting [MediaType.APPLICATION_JSON] `Content-Type` header.
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.1
|
||||
*/
|
||||
fun ServerResponse.BodyBuilder.json() = contentType(MediaType.APPLICATION_JSON_UTF8)
|
||||
fun ServerResponse.BodyBuilder.json() = contentType(MediaType.APPLICATION_JSON)
|
||||
|
||||
/**
|
||||
* Shortcut for setting [MediaType.APPLICATION_XML] `Content-Type` header.
|
||||
|
||||
Reference in New Issue
Block a user