We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0de073a + 4cbe990 commit 5d2ba4dCopy full SHA for 5d2ba4d
src/main/java/com/ning/http/util/AsyncHttpProviderUtils.java
@@ -429,7 +429,14 @@ public static String parseCharset(String contentType) {
429
if (part.trim().startsWith("charset=")) {
430
String[] val = part.split("=");
431
if (val.length > 1) {
432
- return val[1].trim();
+ String charset = val[1].trim();
433
+ // Quite a lot of sites have charset="CHARSET",
434
+ // e.g. charset="utf-8". Note the quotes. This is
435
+ // not correct, but client should be able to handle
436
+ // it (all browsers do, Apache HTTP Client and Grizzly
437
+ // strip it by default)
438
+ // This is a poor man's trim("\"").trim("'")
439
+ return charset.replaceAll("\"", "").replaceAll("'", "")
440
}
441
442
0 commit comments