SPR-7135 - org.springframework.http.MediaType#checkParameters fails to process a Content-Type like application/xml;charset="utf-8"
This commit is contained in:
@@ -180,6 +180,15 @@ public class MediaTypeTests {
|
||||
assertEquals("Invalid charset", Charset.forName("ISO-8859-1"), mediaType.getCharSet());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseQuotedCharset() {
|
||||
String s = "application/xml;charset=\"utf-8\"";
|
||||
MediaType mediaType = MediaType.parseMediaType(s);
|
||||
assertEquals("Invalid type", "application", mediaType.getType());
|
||||
assertEquals("Invalid subtype", "xml", mediaType.getSubtype());
|
||||
assertEquals("Invalid charset", Charset.forName("UTF-8"), mediaType.getCharSet());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseURLConnectionMediaType() throws Exception {
|
||||
String s = "*; q=.2";
|
||||
|
||||
Reference in New Issue
Block a user