Update HttpHeaders.getAccept method
Some servlet containers (iPlanet) parse the Accept header and return
multiple values from request.getHeader("Accept"). The HttpHeaders
getAccept method has been updated to accommodate that hopefully
without causing any other issues.
The extra functionality is in effect only if we find only one
MediaType and there is more than one value for the 'Accept' header.
Issue: SPR-9655
This commit is contained in:
@@ -55,6 +55,16 @@ public class HttpHeadersTests {
|
||||
assertEquals("Invalid Accept header", "text/html, text/plain", headers.getFirst("Accept"));
|
||||
}
|
||||
|
||||
// SPR-9655
|
||||
|
||||
@Test
|
||||
public void acceptiPlanet() {
|
||||
headers.add("Accept", "text/html");
|
||||
headers.add("Accept", "text/plain");
|
||||
List<MediaType> expected = Arrays.asList(new MediaType("text", "html"), new MediaType("text", "plain"));
|
||||
assertEquals("Invalid Accept header", expected, headers.getAccept());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void acceptCharsets() {
|
||||
Charset charset1 = Charset.forName("UTF-8");
|
||||
|
||||
Reference in New Issue
Block a user