Skip to content

Commit

Permalink
Invoke headers function for remote uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Jul 20, 2023
1 parent 5146907 commit 410171a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@uppy/aws-s3/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default class AwsS3 extends UploaderPlugin {
metadata: Object.fromEntries(allowedMetaFields.map(name => [name, file.meta[name]])),
httpMethod: opts.method,
useFormData: opts.formData,
headers: opts.headers,
headers: typeof opts.headers === 'function' ? opts.headers(file) : opts.headers,
})
return res.token
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/tus/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export default class Tus extends UploaderPlugin {
uploadUrl: opts.uploadUrl,
protocol: 'tus',
size: file.data.size,
headers: opts.headers,
headers: (typeof opts.headers === 'function') ? opts.headers(file) : opts.headers,
metadata: file.meta,
}, options)
return res.token
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/xhr-upload/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export default class XHRUpload extends UploaderPlugin {
metadata: Object.fromEntries(allowedMetaFields.map(name => [name, file.meta[name]])),
httpMethod: opts.method,
useFormData: opts.formData,
headers: opts.headers,
headers: typeof opts.headers === 'function' ? opts.headers(file) : opts.headers,
}, options)
return res.token
}
Expand Down

0 comments on commit 410171a

Please sign in to comment.