Skip to content

@uppy/tus, @uppy/transloadit: respect allowedMetaFields and Transloadit Companion URLs for remote files - #6852

Open
qxprakash wants to merge 2 commits into
mainfrom
fix/remote-files-in-uploaders
Open

qxprakash wants to merge 2 commits into
mainfrom
fix/remote-files-in-uploaders

Conversation

@qxprakash

@qxprakash qxprakash commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Two fixes for how uploaders handle remote (Companion) files.

@uppy/tus: allowedMetaFields was ignored for remote files. Local tus uploads only send the allowed meta fields, but for remote files the plugin sent all of file.meta to Companion. It now sends exactly the allowed fields, like local uploads. When name/type aren't allowed, Companion falls back to a generated upload name, just as tusd does for a local upload without them. With the default allowedMetaFields: true nothing changes.

@uppy/transloadit: remote files could be moved to a non-Transloadit companion_url. When an Assembly is created, remote files hosted on Transloadit's Companion are switched to the Companion the Assembly status names. The check only looked at the file's current Companion URL, with an unanchored regex, and never at the new URL. Now both URLs must be an https Transloadit Companion URL (https://api2[-<machine>].transloadit.com/companion, trailing slash allowed), so a status can't move a remote file's requests, which carry its Companion credentials, to another host or to plain http. Regional hosts like api2-us-east-1 also match now; before, the hyphen kept them from matching.

Tests

  • tus: a remote file sends only the allowed fields to Companion (fails without the fix).
  • Transloadit: a non-Transloadit, look-alike or http companion_url leaves the file's Companion unchanged; Transloadit machine and regional hosts are still used (fails without the fix).
  • tus and Transloadit suites pass; types and Biome clean.

🤖 Generated with Claude Code

…nly where allowed

@uppy/tus sent every meta field of a remote file to Companion, ignoring
allowedMetaFields. It now sends the allowed fields plus name and type,
which Companion names the upload after and which local uploads always
send too.

@uppy/transloadit moved remote files to the Assembly status's
companion_url whenever the file's Companion looked like Transloadit's (an
unanchored match), without checking the new URL. Both must now be a
Transloadit Companion URL; regional hosts like api2-us-east-1 match.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T20:33:22.493546Z
We couldn’t complete this review. Comment @codex review to try again.
487f0b4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4243ea

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@uppy/tus Patch
@uppy/transloadit Patch
uppy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

… https

Sending name and type to Companion regardless of allowedMetaFields leaked
a file name the app chose not to send; local tus uploads only send them
when they are allowed. Remote files now send exactly the allowed fields.

The Transloadit Companion check accepted http, so a status could move a
remote file's requests, with their Companion credentials, to plain http.
Only https Transloadit Companion URLs match now.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The URL-validation test tears down before the assembly is installed, allowing preprocessing to open an EventSource and polling timer afterward and leave background network activity running.

1 open issue
What changed in this PR

This PR aligns remote-file uploads with Uppy’s metadata restrictions and limits Transloadit Companion rerouting to trusted HTTPS URLs.

Changes:

  • Apply allowedMetaFields to remote tus uploads.
  • Validate both Companion URLs before rerouting, including support for regional Transloadit hosts.
  • Add regression tests and patch-release notes.
File Description
packages/​@uppy/​tus/​test/​index.test.ts Tests metadata filtering for remote uploads.
packages/​@uppy/​tus/​src/​index.ts Filters metadata sent to Companion.
packages/​@uppy/​transloadit/​test/​index.test.js Tests trusted and rejected Companion destinations.
packages/​@uppy/​transloadit/​src/​index.ts Validates source and destination Companion URLs.
.changeset/​remote-files-meta-and-companion.md Documents both fixes for patch releases.

Review effort: Balanced

Comment on lines +647 to +651
uppy.upload().catch(() => {})
await created

expect(uppy.getFile(id).remote.companionUrl).toBe(expected)
uppy.cancelAll()

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants