INT-3120: Remove Accept-Charset from Response

`StringHttpMessageConverter` adds `Accept-Charset` header by default.
By RFC 2616 `Accept-Charset` is a Request header,
so it won't be presented in the response.

Turn off `writeAcceptCharset` in the `HttpRequestHandlingEndpointSupport`.

JIRA: https://jira.springsource.org/browse/INT-3120
This commit is contained in:
Artem Bilan
2013-09-12 11:37:44 +03:00
committed by Gary Russell
parent 937ac9647a
commit 5cb64f81f6
2 changed files with 8 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ import org.springframework.web.util.UrlPathHelper;
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Gary Russell
* @author Artem Bilan
* @since 2.0
*/
public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySupport
@@ -147,7 +148,9 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa
this.expectReply = expectReply;
this.messageConverters.add(new MultipartAwareFormHttpMessageConverter());
this.messageConverters.add(new ByteArrayHttpMessageConverter());
this.messageConverters.add(new StringHttpMessageConverter());
StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
stringHttpMessageConverter.setWriteAcceptCharset(false);
this.messageConverters.add(stringHttpMessageConverter);
this.messageConverters.add(new ResourceHttpMessageConverter());
this.messageConverters.add(new SourceHttpMessageConverter());
if (jaxb2Present) {