Skip to content

Commit b6ff12d

Browse files
committed
Expose protected method in AbstractJackson2HttpMessageConverter
Closes gh-25509
1 parent b1d8406 commit b6ff12d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,15 @@ private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) th
285285
}
286286
}
287287

288-
private static Charset getCharset(@Nullable MediaType contentType) {
288+
/**
289+
* Return the charset to use for JSON input.
290+
* <p>By default this is either the charset from the input {@code MediaType}
291+
* or otherwise falling back on {@code UTF-8}.
292+
* @param contentType the content type of the HTTP input message
293+
* @return the charset to use
294+
* @since 5.1.18
295+
*/
296+
protected static Charset getCharset(@Nullable MediaType contentType) {
289297
if (contentType != null && contentType.getCharset() != null) {
290298
return contentType.getCharset();
291299
}

0 commit comments

Comments
 (0)