Skip to content

Commit

Permalink
Expose protected method in AbstractJackson2HttpMessageConverter
Browse files Browse the repository at this point in the history
Closes gh-25509
  • Loading branch information
rstoyanchev committed Sep 8, 2020
1 parent 32cbbfe commit 385c97d
Showing 1 changed file with 10 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -284,7 +284,15 @@ private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) th
}
}

private static Charset getCharset(@Nullable MediaType contentType) {
/**
* Return the charset to use for JSON input.
* <p>By default this is either the charset from the input {@code MediaType}
* or otherwise falling back on {@code UTF-8}.
* @param contentType the content type of the HTTP input message
* @return the charset to use
* @since 5.1.18
*/
protected Charset getCharset(@Nullable MediaType contentType) {
if (contentType != null && contentType.getCharset() != null) {
return contentType.getCharset();
}
Expand Down

0 comments on commit 385c97d

Please sign in to comment.