INT-3697: Map contentType to HTTP Response

JIRA: https://jira.spring.io/browse/INT-3697

Since Spring Integration 4.0 the `MessageHeaders` had been moved to the Spring Messaging module
and `MessageHeaders.CONTENT_TYPE` had been changed from `content-type` name to the `contentType`.

Previously the automatic mapping of `contentType` to the HTTP Request `Content-Type` has been introduced
for the `HttpRequestExecutingMessageHandler`.

This fix do the same for the HTTP Response in case of HTTP Inbound Endpoint.
This allows to transfer HTTP headers automatically from underlying HTTP Outbound Endpoint for HTTP Proxy scenario.
The response from that external HTTP service maybe changed during a downstream flow before sending HTTP Response from the HTTP Inbound Endpoint.
Before this we was forced to map `contentType` to `Content-Type` manually or just rely on the `HttpMessageConverter`s.

**Cherry-pick to 4.1.x**
This commit is contained in:
Artem Bilan
2015-04-13 13:58:04 +03:00
parent d8f175edac
commit 3e851d2e1b
3 changed files with 19 additions and 5 deletions

View File

@@ -490,7 +490,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
}
private boolean shouldMapOutboundHeader(String headerName) {
String[] outboundHeaderNamesLower = this.outboundHeaderNamesLower;
String[] outboundHeaderNamesLower = this.outboundHeaderNamesLowerWithContentType;
if (this.isDefaultInboundMapper) {
/*