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

Commit 922ce40

Browse files
authored
Merge pull request #161 from mikemonteith/0.9.7
Don't stringify body if Content-Type is application/json
2 parents 74ae0ce + e6a9c17 commit 922ce40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/polyfill/Fetch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class RNFetchBlobFetchPolyfill {
4747
// When request body is a Blob, use file URI of the Blob as request body.
4848
else if (body.isRNFetchBlobPolyfill)
4949
promise = Promise.resolve(RNFetchBlob.wrap(body.blobPath))
50-
else if (typeof body !== 'object')
50+
else if (typeof body !== 'object' && options.headers['Content-Type'] !== 'application/json')
5151
promise = Promise.resolve(JSON.stringify(body))
5252
else if (typeof body !== 'string')
5353
promise = Promise.resolve(body.toString())

0 commit comments

Comments
 (0)