Revert "INT-4135: Ignore case check for HTTP Content-Type"

This reverts commit a82bca653b.

Backporting causes some breaking changes.

The work around is to use a header enricher/filter to move the
content-type header to contentType.
This commit is contained in:
Gary Russell
2016-10-10 14:57:48 -04:00
parent a82bca653b
commit c4908426fc
2 changed files with 1 additions and 10 deletions

View File

@@ -462,7 +462,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
if (logger.isDebugEnabled()) {
logger.debug(MessageFormat.format("setting headerName=[{0}], value={1}", name, value));
}
if (CONTENT_TYPE.equalsIgnoreCase(name)) {
if (CONTENT_TYPE.equals(name)) {
name = MessageHeaders.CONTENT_TYPE;
}
this.setMessageHeader(target, name, value);

View File

@@ -581,15 +581,6 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
assertEquals(MediaType.valueOf("text/plain"), httpHeaders.getContentType());
}
@Test
public void testContentTypeInboundHeader() throws Exception {
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.inboundMapper();
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE.toLowerCase(), "text/plain");
Map<String, ?> result = mapper.toHeaders(headers);
assertEquals(MediaType.valueOf("text/plain"), result.get(MessageHeaders.CONTENT_TYPE));
}
public static class TestClass {