MimeType parsing properly handles quoted semicolons
Issue: SPR-14986
This commit is contained in:
@@ -87,6 +87,16 @@ public class MimeTypeTests {
|
||||
assertEquals("Invalid charset", StandardCharsets.UTF_8, mimeType.getCharset());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parseQuotedSeparator() {
|
||||
String s = "application/xop+xml;charset=utf-8;type=\"application/soap+xml;action=\\\"http://x.y.z\\\"\"";
|
||||
MimeType mimeType = MimeType.valueOf(s);
|
||||
assertEquals("Invalid type", "application", mimeType.getType());
|
||||
assertEquals("Invalid subtype", "xop+xml", mimeType.getSubtype());
|
||||
assertEquals("Invalid charset", StandardCharsets.UTF_8, mimeType.getCharset());
|
||||
assertEquals("\"application/soap+xml;action=\\\"http://x.y.z\\\"\"", mimeType.getParameter("type"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void withConversionService() {
|
||||
ConversionService conversionService = new DefaultConversionService();
|
||||
|
||||
Reference in New Issue
Block a user