diff --git a/packages/@uppy/aws-s3/src/index.js b/packages/@uppy/aws-s3/src/index.js index 8d48a35c40..f4201429a8 100644 --- a/packages/@uppy/aws-s3/src/index.js +++ b/packages/@uppy/aws-s3/src/index.js @@ -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 } diff --git a/packages/@uppy/tus/src/index.js b/packages/@uppy/tus/src/index.js index 39022f3d82..368e935a59 100644 --- a/packages/@uppy/tus/src/index.js +++ b/packages/@uppy/tus/src/index.js @@ -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 diff --git a/packages/@uppy/xhr-upload/src/index.js b/packages/@uppy/xhr-upload/src/index.js index a8a331ff78..bca07c5caa 100644 --- a/packages/@uppy/xhr-upload/src/index.js +++ b/packages/@uppy/xhr-upload/src/index.js @@ -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 }