INT-4135: Ignore case check for HTTP Content-Type
JIRA: https://jira.spring.io/browse/INT-4135 The incoming `Content-Type` HTTP header can be in any arbitrary case. Fix `DefaultHttpHeaderMapper` `Content-Type` header re-mapping to the `MessageHeaders.CONTENT_TYPE` via `equalsIgnoreCase()` comparison **Cherry-pick to 4.3.x**
This commit is contained in:
committed by
Gary Russell
parent
c75b72ffe7
commit
a82bca653b
@@ -581,6 +581,15 @@ 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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user