Skip to content

Commit 385c97d

Browse files
committed
Expose protected method in AbstractJackson2HttpMessageConverter
Closes gh-25509
1 parent 32cbbfe commit 385c97d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -284,7 +284,15 @@ private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) th
284284
}
285285
}
286286

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

0 commit comments

Comments
 (0)