You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IllegalCharsetNameException in HttpResponse getContentCharset() if charset is malformed #323
🚨This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Fatal Exception: java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by java.nio.charset.IllegalCharsetNameException: %s
at java.nio.charset.Charset.checkCharsetName(Charset.java:197)
at java.nio.charset.Charset.forName(Charset.java:295)
at com.google.api.client.http.HttpMediaType.getCharsetParameter(HttpMediaType.java:321)
at com.google.api.client.http.HttpResponse.getContentCharset(HttpResponse.java:526)
at com.google.api.client.http.HttpResponse.parseAsString(HttpResponse.java:516)
at com.google.api.client.http.HttpResponseException$Builder.(HttpResponseException.java)
at com.google.api.client.http.HttpResponseException.(HttpResponseException.java)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1061)
The place where this occurs is in HttpMediaType, which does not enforce valid parameter to be passed to Charset.forName()
/** * Returns the specified charset or {@code null} if unset. */publicCharsetgetCharsetParameter() {
Stringvalue = getParameter("charset");
returnvalue == null ? null : Charset.forName(value);
}
🚨This issue needs some love.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
ajaaym commentedon Dec 5, 2018
This is fixed
Doctoror commentedon Dec 5, 2018
Seems nothing changed in implementation when looking at the current master link you provided.
fix googleapis#323 IllegalCharsetNameException in HttpResponse getCon…
ajaaym commentedon Dec 5, 2018
Sorry I misread original issue. Created PR to fix this.
Fix building HttpResponseException when charset is malformed (#535)
chore: remove obsolete parent POM (googleapis#323)