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

Commit 42b13a5

Browse files
committed
Fix #10
1 parent dc7b730 commit 42b13a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const fetch = (...args) => {
2525
let [method, url, headers, body] = [...args]
2626
let nativeMethodName = Array.isArray(body) ? 'fetchBlobForm' : 'fetchBlob'
2727

28-
RNFetchBlob[nativeMethodName](method, url, headers, body, (err, ...data) => {
28+
RNFetchBlob[nativeMethodName](method, url, headers || {}, body, (err, ...data) => {
2929
if(err)
3030
reject(new Error(err, ...data))
3131
else

test/tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515

1616
const FILENAME = `${Platform.OS}-0.4.0-${Date.now()}.png`
1717
// paste your test config here
18-
const TEST_SERVER_URL = 'http://your-local-ip:8123'
19-
const DROPBOX_TOKEN = 'drop-box-api-token'
18+
const TEST_SERVER_URL = 'http://192.168.17.207:8123'
19+
const DROPBOX_TOKEN = 'fsXcpmKPrHgAAAAAAAAAEGxFXwhejXM_E8fznZoXPhHbhbNhA-Lytbe6etp1Jznz'
2020

2121
const ctx = new RNTest.TestContext()
2222
const Assert = RNTest.Assert
@@ -88,8 +88,8 @@ ctx.describe('Upload multipart/form-data', async function(report, data) {
8888

8989
ctx.describe('Compare uploaded multipart image', async function(report) {
9090
// try {
91-
let resp = await RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/test-img.png`, {})
92-
let resp2 = await RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/test-text.txt`, {})
91+
let resp = await RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/test-img.png`)
92+
let resp2 = await RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/test-text.txt`)
9393
console.log(resp)
9494
console.log(resp2)
9595
report({

0 commit comments

Comments
 (0)