Merge branch '6.2.x'

This commit is contained in:
Brian Clozel
2025-06-03 18:07:22 +02:00
4 changed files with 88 additions and 1 deletions

View File

@@ -124,6 +124,7 @@ public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHt
* Detect the charset from the given {@link HttpHeaders#getContentType()}.
* @param httpHeaders the current HTTP headers
* @return the charset defined in the content type header, or {@code null} if not found
* @since 6.2.8
*/
protected @Nullable Charset detectCharset(HttpHeaders httpHeaders) {
MediaType contentType = httpHeaders.getContentType();

View File

@@ -160,6 +160,13 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa
}
}
/**
* Process {@code source} with {@code charset}.
* @param source source to process
* @param charset charset to use
* @return source
* @since 6.2.8
*/
protected Source processSource(Source source, @Nullable Charset charset) {
if (source instanceof StreamSource streamSource) {
InputSource inputSource = new InputSource(streamSource.getInputStream());