Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 21, 2024

Conversation

netdown
Copy link
Contributor

@netdown netdown commented May 18, 2024

Conditionally calling the headers argument was missing from getCompanionClientArgs.

Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/tus/lib/index.js b/packages/@uppy/tus/lib/index.js
index 281ca15..a55f92a 100644
--- a/packages/@uppy/tus/lib/index.js
+++ b/packages/@uppy/tus/lib/index.js
@@ -404,6 +404,9 @@ function _getCompanionClientArgs2(file) {
   if (file.tus) {
     Object.assign(opts, file.tus);
   }
+  if (typeof opts.headers === "function") {
+    opts.headers = opts.headers(file);
+  }
   return {
     ...((_file$remote = file.remote) == null ? void 0 : _file$remote.body),
     endpoint: opts.endpoint,

Copy link
Member

@Murderlon Murderlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@Murderlon Murderlon merged commit a57bf8f into transloadit:main May 21, 2024
5 checks passed
github-actions bot added a commit that referenced this pull request May 22, 2024
| Package         | Version | Package         | Version |
| --------------- | ------- | --------------- | ------- |
| @uppy/companion |  4.13.3 | @uppy/tus       |   3.5.5 |
| @uppy/svelte    |   3.1.5 | uppy            |  3.25.4 |

- @uppy/svelte: do not attempt removing plugin before it's created (Antoine du Hamel / #5186)
- docs: Update `facebook.mdx` (Evgenia Karunus)
- @uppy/tus: fix no headers passed to companion if argument is a function (netdown / #5182)
- @uppy/companion: fix google drive gsuite export large size (Milan Nakum / #5144)
- meta: Improve provider docs: Box & Zoom (Evgenia Karunus / #5166)
- meta: add MDX file to `lint-staged` list (Antoine du Hamel / #5174)
- @uppy/companion: handle ws `'error'` event (Mikael Finstad / #5167)
Murderlon added a commit that referenced this pull request May 28, 2024
* 4.x: (38 commits)
  docs: assume tree-shaking bundler is the most common case (#5160)
  @uppy/core: remove `reason` (#5159)
  Release: [email protected] (#5194)
  Release: [email protected] (#5193)
  @uppy/companion: remove `chalk` from dependencies (#5178)
  @uppy/transloadit: do not cancel assembly when removing all files (#5191)
  @uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)
  meta: improve changelog generator (#5190)
  Release: [email protected] (#5189)
  examples: add SvelteKit example (#5181)
  @uppy/companion: fix missing `await`
  Release: [email protected] (#5188)
  @uppy/svelte: do not attempt removing plugin before it's created (#5186)
  Update facebook.mdx
  fixup! @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/core: resolve some (breaking) TODOs (#4824)
  @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/companion: fix google drive gsuite export large size (#5144)
  @uppy/companion: encode `uploadId` (#5168)
  @uppy/companion: bump `express-session` (#5177)
  ...
Murderlon added a commit that referenced this pull request Jun 10, 2024
* main: (262 commits)
  Release: [email protected] (#5223)
  meta: remove Companion's `prepublishOnly` (#5220)
  docs: document clearUploadedFiles (#5204)
  @uppy/webcam: add missing types for `recordedVideo` (#5208)
  @uppy/core: check capabilities in clearUploadedFiles (#5201)
  PartialTree - change the `maxTotalFileSize` error (#5203)
  @uppy/transloadit: remove `updateNumberOfFilesInAssembly` (#5202)
  @uppy/aws-s3: resolve all headers on response (#5195)
  Improve provider docs: OneDrive (#5196)
  Release: [email protected] (#5193)
  @uppy/transloadit: do not cancel assembly when removing all files (#5191)
  @uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179)
  meta: improve changelog generator (#5190)
  Release: [email protected] (#5188)
  @uppy/svelte: do not attempt removing plugin before it's created (#5186)
  Update facebook.mdx
  fixup! @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/tus: fix no headers passed to companion if argument is a function (#5182)
  @uppy/companion: fix google drive gsuite export large size (#5144)
  Improve provider docs: Box & Zoom (#5166)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants