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:
committed by
Stephane Nicoll
parent
ff2d423fcb
commit
6d60c23460
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user