Skip to content

Commit

Permalink
Add headers['content-type']
Browse files Browse the repository at this point in the history
// this is required to support formData on android
  • Loading branch information
pierre275 committed Jan 26, 2023
1 parent 2e14e6b commit 6aaa260
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion polyfill/Fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class ReactNativeBlobUtilFetchPolyfill {
log.verbose('convert FormData to blob body');
promise = Blob.build(body).then((b) => {
blobCache = b;
options.headers['Content-Type'] = 'multipart/form-data;boundary=' + b.multipartBoundary;

const contentType = 'multipart/form-data;boundary=' + b.multipartBoundary
options.headers['Content-Type'] = contentType;
options.headers['content-type'] = contentType;
return Promise.resolve(URIUtil.wrap(b._ref));
});
}
Expand Down

0 comments on commit 6aaa260

Please sign in to comment.