Commit 91a09ea3 by Emanuele Tidó Committed by GitHub

Update OkHttpDataSource.java

set responseBody to Util.EMPTY_BYTE_ARRAY when an IOException occurs trying to get his value from inputStream
parent 65489084
...@@ -309,8 +309,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource { ...@@ -309,8 +309,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
try { try {
errorResponseBody = Util.toByteArray(Assertions.checkNotNull(responseByteStream)); errorResponseBody = Util.toByteArray(Assertions.checkNotNull(responseByteStream));
} catch (IOException e) { } catch (IOException e) {
throw new InvalidResponseCodeException( errorResponseBody = Util.EMPTY_BYTE_ARRAY;
responseCode, response.message(), headers, dataSpec, null);
} }
closeConnectionQuietly(); closeConnectionQuietly();
InvalidResponseCodeException exception = InvalidResponseCodeException exception =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment