Disable Accept-Charset Header in String converter

This commit prevents the `Accept-Charset` from being written by the
StringHttpMessageConverter. This feature is enabled by default in the
framework and writes a *quite long* response header with all charsets
supported by the server.

Closes gh-2370, see gh-1800
This commit is contained in:
Brian Clozel 2015-01-16 09:47:44 +01:00 committed by Stephane Nicoll
parent ff2d423fcb
commit 6d60c23460

View File

@ -144,7 +144,9 @@ public class HttpMessageConvertersAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public StringHttpMessageConverter stringHttpMessageConverter() {
return new StringHttpMessageConverter(this.encodingProperties.getCharset());
StringHttpMessageConverter converter = new StringHttpMessageConverter(this.encodingProperties.getCharset());
converter.setWriteAcceptCharset(false);
return converter;
}
}