Skip to content

Commit

Permalink
Fix AWS S3 upload on React Native (#3064)
Browse files Browse the repository at this point in the history
* Fix AWS S3 upload on React Native

* Update packages/@uppy/aws-s3/src/MiniXHRUpload.js

* Update packages/@uppy/aws-s3/src/MiniXHRUpload.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Update MiniXHRUpload.js

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
3 people committed Oct 4, 2021
1 parent 3002201 commit 9840127
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@uppy/aws-s3/src/MiniXHRUpload.js
Expand Up @@ -211,8 +211,9 @@ module.exports = class MiniXHRUpload {

xhr.open(opts.method.toUpperCase(), opts.endpoint, true)
// IE10 does not allow setting `withCredentials` and `responseType`
// before `open()` is called.
xhr.withCredentials = opts.withCredentials
// before `open()` is called. It’s important to set withCredentials
// to a boolean, otherwise React Native crashes
xhr.withCredentials = Boolean(opts.withCredentials)
if (opts.responseType !== '') {
xhr.responseType = opts.responseType
}
Expand Down

0 comments on commit 9840127

Please sign in to comment.