Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit dbb53f9

Browse files
committed
Add Android HTTP Close body
1 parent d766c7c commit dbb53f9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobReq.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,7 @@ private void done(Response resp) {
456456
// It uses customized response body which is able to report download progress
457457
// and write response data to destination path.
458458
resp.body().bytes();
459-
} catch (Exception ignored) {
460-
ignored.printStackTrace();
461-
}
459+
} catch (Exception ignored) { }
462460
callback.invoke(null, RNFetchBlobConst.RNFB_RESPONSE_PATH, this.destPath);
463461
break;
464462
default:
@@ -469,8 +467,9 @@ private void done(Response resp) {
469467
}
470468
break;
471469
}
472-
if(!resp.isSuccessful())
473-
resp.body().close();
470+
// if(!resp.isSuccessful())
471+
// resp.body().close();
472+
resp.body().close();
474473
releaseTaskResource();
475474
}
476475

test/test-0.9.4.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ describe('issue #105', (report, done) => {
3535
.then((res) => {
3636
tmp = res.path()
3737
return RNFetchBlob.fetch('POST', `${TEST_SERVER_URL}/upload-form`, {
38-
'Content-Type' : 'multipart/form-data'
38+
'Content-Type' : 'multipart/form-data',
39+
'Expect' : '100-continue'
3940
}, [
4041
{ name : 'data', data : 'issue#105 test' },
4142
{ name : 'file', filename : 'github.png', data : RNFetchBlob.wrap(tmp) }

0 commit comments

Comments
 (0)