mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
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:
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user