Skip to content

Commit dbed840

Browse files
authored
Update Fetch.js
#369 Resolution to the above issue, the RN code passes two instances of Content-Type, one containing capital letters and the other in lower case. The Android native code saves those options after applying .toLowerCase() on them. The data in the lower case content-type overwrote the data in the Content-Type, and since the data on both the keys wasn't updated together at the fixed part of the code, it overwrote it with invalid data and caused the request to fail.
1 parent d8c79f6 commit dbed840

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

polyfill/Fetch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class RNFetchBlobFetchPolyfill {
4040
promise = Blob.build(body).then((b) => {
4141
blobCache = b
4242
options.headers['Content-Type'] = 'multipart/form-data;boundary=' + b.multipartBoundary
43+
options.headers['content-type'] = 'multipart/form-data;boundary=' + b.multipartBoundary
4344
return Promise.resolve(RNFetchBlob.wrap(b._ref))
4445
})
4546
}

0 commit comments

Comments
 (0)