Browse Source

Fix OkHttp3 unexpected end of stream error

reference https://github.com/square/okhttp/issues/2738
Ben Hsieh 7 years ago
parent
commit
d31c414e15
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

+ 1
- 1
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java View File

@@ -332,7 +332,7 @@ public class RNFetchBlobReq extends BroadcastReceiver implements Runnable {
332 332
             clientBuilder.retryOnConnectionFailure(false);
333 333
             clientBuilder.followRedirects(true);
334 334
 
335
-            OkHttpClient client = clientBuilder.build();
335
+            OkHttpClient client = clientBuilder.retryOnConnectionFailure(true).build();
336 336
             Call call =  client.newCall(req);
337 337
             taskTable.put(taskId, call);
338 338
             call.enqueue(new okhttp3.Callback() {