From a57bf8f358a7a866f0acbd438a814d03198ac8e0 Mon Sep 17 00:00:00 2001 From: netdown Date: Tue, 21 May 2024 16:17:19 +0200 Subject: [PATCH] @uppy/tus: fix no headers passed to companion if argument is a function (#5182) Update index.ts --- packages/@uppy/tus/src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/@uppy/tus/src/index.ts b/packages/@uppy/tus/src/index.ts index 9f0072d799..4675fd6291 100644 --- a/packages/@uppy/tus/src/index.ts +++ b/packages/@uppy/tus/src/index.ts @@ -545,6 +545,10 @@ export default class Tus extends BasePlugin< Object.assign(opts, file.tus) } + if (typeof opts.headers === 'function') { + opts.headers = opts.headers(file) + } + return { ...file.remote?.body, endpoint: opts.endpoint,