diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java index 34aab2fd47..f2ddc0d69d 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/HttpRequestHandlingEndpointSupport.java @@ -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) { diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java index 61bece4264..d9dccfe670 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/inbound/HttpRequestHandlingMessagingGatewayTests.java @@ -16,6 +16,7 @@ package org.springframework.integration.http.inbound; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.mock; @@ -53,6 +54,7 @@ import org.springframework.util.SerializationUtils; * @author Mark Fisher * @author Gary Russell * @author Gunnar Hillert + * @author Artem Bilan * @since 2.0 */ public class HttpRequestHandlingMessagingGatewayTests { @@ -151,6 +153,8 @@ public class HttpRequestHandlingMessagingGatewayTests { MockHttpServletResponse response = new MockHttpServletResponse(); gateway.handleRequest(request, response); assertEquals("HELLO", response.getContentAsString()); + //INT-3120 + assertNull(response.getHeader("Accept-Charset")); } @Test