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

Do not extract keys from empty fields. #1569

Merged
merged 1 commit into from
May 20, 2019
Merged

Conversation

alexnj
Copy link
Contributor

@alexnj alexnj commented May 18, 2019

Per documentation at https://uppy.io/docs/aws-s3/, fields can be empty.
"For presigned PUT uploads, this should be left empty."

Adding a safety check before attempting to extract keys.

Per documentation at https://uppy.io/docs/aws-s3/, `fields` can be empty. 
"For presigned PUT uploads, this should be left empty."

Adding a safety check before attempting to extract keys.
@arturi
Copy link
Contributor

arturi commented May 20, 2019

Thank you for the PR!

We are doing something different for xhr-uploads, I wonder if we need to mimic that in aws-s3 then, @goto-bus-stop:

const metaFields = Array.isArray(opts.metaFields)
? opts.metaFields
// Send along all fields by default.
: Object.keys(file.meta)

Copy link
Contributor

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

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

We should not send file metadata to S3 in form fields (like XHRUpload does), so the empty array is the correct approach 👍

@arturi arturi merged commit 2141aa0 into transloadit:master May 20, 2019
@arturi
Copy link
Contributor

arturi commented May 20, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants