media types in HTTP Accept headers can be parsed with single quotes (-> Android 2.x)

Issue: SPR-9734
This commit is contained in:
Juergen Hoeller
2012-08-31 17:03:28 +02:00
parent d7fd70fa08
commit 8b09b52720
2 changed files with 14 additions and 1 deletions

View File

@@ -376,7 +376,12 @@ public class MediaType implements Comparable<MediaType> {
}
private boolean isQuotedString(String s) {
return s.length() > 1 && s.startsWith("\"") && s.endsWith("\"") ;
if (s.length() < 2) {
return false;
}
else {
return ((s.startsWith("\"") && s.endsWith("\"")) || (s.startsWith("'") && s.endsWith("'")));
}
}
private String unquote(String s) {