Browse Source

Do not extract keys from empty `fields`.

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.
Alex N. Jose 6 years ago
parent
commit
66a8a4a852
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/@uppy/aws-s3/src/index.js

+ 1 - 1
packages/@uppy/aws-s3/src/index.js

@@ -138,7 +138,7 @@ module.exports = class AwsS3 extends Plugin {
           method,
           formData: method.toLowerCase() === 'post',
           endpoint: url,
-          metaFields: Object.keys(fields)
+          metaFields: fields ? Object.keys(fields) : []
         }
 
         if (headers) {