Jelajahi Sumber

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

Update index.ts
netdown 11 bulan lalu
induk
melakukan
a57bf8f358
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  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)
     }
 
+    if (typeof opts.headers === 'function') {
+      opts.headers = opts.headers(file)
+    } 
+
     return {
       ...file.remote?.body,
       endpoint: opts.endpoint,