Skip to content

@uppy/companion: support oCIS public share links in the WebDAV provider#6333

Open
dj4oC wants to merge 1 commit into
transloadit:mainfrom
dj4oC:fix/companion-webdav-ocis-public-links
Open

@uppy/companion: support oCIS public share links in the WebDAV provider#6333
dj4oC wants to merge 1 commit into
transloadit:mainfrom
dj4oC:fix/companion-webdav-ocis-public-links

Conversation

@dj4oC

@dj4oC dj4oC commented Jun 15, 2026

Copy link
Copy Markdown

Problem

Companion's WebDAV provider resolves Nextcloud/ownCloud/oCIS public share links (https://host/s/<token>) to a single hard-coded WebDAV endpoint, /public.php/webdav/:

https://github.com/transloadit/uppy/blob/main/packages/@uppy/companion/src/server/provider/webdav/index.ts

That path works for Nextcloud and ownCloud 10, but oCIS (ownCloud Infinite Scale) serves public shares at /dav/public-files/<token>. Hitting /public.php/webdav/ on oCIS returns an HTML page instead of a 207 Multi-Status, so the import fails with:

Invalid response: No root multistatus found

Fixes #6007. As discussed in #6117, there is no standard WebDAV (or reliably-shaped capabilities) way to discover the correct public-share path across servers.

Fix

When a public share link is detected, probe the known public-share WebDAV endpoints and use the first that actually responds as WebDAV (a cheap depth-0 PROPFIND); hitting the wrong endpoint throws No root multistatus found, so we move on to the next candidate:

  • /public.php/webdav/ — Nextcloud, ownCloud 10
  • /dav/public-files/<token> — oCIS

The resolved endpoint is cached on the session (publicLinkUrl) so subsequent list/download requests don't re-probe. Behavior for Nextcloud / ownCloud 10 is unchanged (their endpoint is the first candidate and matches immediately); oCIS now works via the fallback. If no candidate answers as WebDAV, it falls back to the previous default endpoint so the original, meaningful error still surfaces.

This is the "probe the oCIS endpoint alongside the current path" approach proposed in #6117, and it generalizes cleanly if more server-specific endpoints need to be added later.

Testing

Added packages/@uppy/companion/test/webdav.test.ts covering the resolver:

  • Nextcloud/ownCloud → /public.php/webdav/ (oCIS endpoint never probed)
  • oCIS → falls back to /dav/public-files/<token> (ownCloud path probed first)
  • cached publicLinkUrl is reused without re-probing
  • no candidate responds → falls back to the default endpoint
  • /index.php is stripped from the base URL
  • a tokenless /s/ URL throws

yarn workspace @uppy/companion test passes (124 tests), yarn workspace @uppy/companion typecheck is clean, and Biome is clean on the changed files. A changeset is included (@uppy/companion patch).

Companion's WebDAV provider hard-coded the /public.php/webdav/ endpoint when
resolving /s/<token> public share links. That works for Nextcloud and
ownCloud 10, but oCIS (ownCloud Infinite Scale) serves public shares at
/dav/public-files/<token>, so importing an oCIS public link failed with
"Invalid response: No root multistatus found".

Probe the known public-share WebDAV endpoints and use the first that answers
as WebDAV, caching the resolved endpoint on the session so later list/download
requests don't re-probe. This fixes oCIS public links without changing
behavior for Nextcloud / ownCloud 10.

Fixes transloadit#6007. Addresses transloadit#6117.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: David Walter <david.walter@kiteworks.com>
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6011ef1

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

This PR includes changesets to release 1 package
Name Type
@uppy/companion 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

@dj4oC

dj4oC commented Jun 16, 2026

Copy link
Copy Markdown
Author

@qxprakash @Murderlon @mifi would you mind to review this one? Thank you very much

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.

[companion] WebDAV import does not work with oCIS public links

1 participant