Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AWS S3 upload on React Native #3064

Merged
merged 4 commits into from Oct 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/@uppy/aws-s3/src/MiniXHRUpload.js
Expand Up @@ -236,8 +236,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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
// to a boolean, otherwise React Native crashes
// to a boolean, otherwise React Native crashes.

xhr.withCredentials = Boolean(opts.withCredentials)
if (opts.responseType !== '') {
xhr.responseType = opts.responseType
}
Expand Down