Browse Source

@uppy/tus: fix no headers passed to companion if argument is a function (#5182)

Update index.ts
netdown 11 months ago
parent
commit
a57bf8f358
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/@uppy/tus/src/index.ts

+ 4 - 0
packages/@uppy/tus/src/index.ts

@@ -545,6 +545,10 @@ export default class Tus<M extends Meta, B extends Body> extends BasePlugin<
       Object.assign(opts, file.tus)
       Object.assign(opts, file.tus)
     }
     }
 
 
+    if (typeof opts.headers === 'function') {
+      opts.headers = opts.headers(file)
+    } 
+
     return {
     return {
       ...file.remote?.body,
       ...file.remote?.body,
       endpoint: opts.endpoint,
       endpoint: opts.endpoint,