We recently had a complaint from a client about a 400 response from the token endpoint that was causing AppAuth to throw a FileNotFoundException.
com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:238) at
com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
It looks like it came from this library:
https://android.googlesource.com/platform/external/okhttp/+/781c9c2/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/HttpURLConnectionImpl.java
@Override public final InputStream getInputStream() throws IOException {
if (getResponseCode() >= HTTP_BAD_REQUEST) {
throw new FileNotFoundException(url.toString());
}
So instead of returning the 400, and other details about the message, it just throws a very confusing FileNotFoundException... which you would think would be a 404 if it really couldn't find a resource.
It makes me wonder about the quality of the underlying HTTP library. Is okhttp really good enough? Wouldn't you want to use at least goodhttp or even greathttp?
We recently had a complaint from a client about a 400 response from the token endpoint that was causing AppAuth to throw a
FileNotFoundException.It looks like it came from this library:
https://android.googlesource.com/platform/external/okhttp/+/781c9c2/okhttp-urlconnection/src/main/java/com/squareup/okhttp/internal/huc/HttpURLConnectionImpl.javaSo instead of returning the 400, and other details about the message, it just throws a very confusing FileNotFoundException... which you would think would be a 404 if it really couldn't find a resource.
It makes me wonder about the quality of the underlying HTTP library. Is
okhttpreally good enough? Wouldn't you want to use at leastgoodhttpor evengreathttp?