Skip to content

fix: DAV discovery and OPTIONS behind the OpenCloud proxy (#47, #48) - #49

Merged
gnacho merged 3 commits into
mainfrom
fix/47-well-known-dav-root
Nov 7, 2026
Merged

gnacho merged 3 commits into
mainfrom
fix/47-well-known-dav-root

Conversation

@gnacho

@gnacho gnacho commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Two defects found while checking whether third-party CalDAV clients can use the server behind the OpenCloud proxy.

Well-known discovery in -dav-root mode

newHandler returned right after mounting the catch-all DAV handler, so /.well-known/caldav and /.well-known/carddav were only registered in standalone mode. Behind the proxy the request fell into the generic DAV handler, which read the path as /<user>/<collection> and answered 403 dav: access to another user's data is not allowed.

Both routes are now registered before the catch-all, and a test builds the handler with davRoot=true. It fails with the same 403 before the change.

OPTIONS without identity

The OpenCloud proxy does not authenticate OPTIONS, so davcloud received it with no X-Remote-User and answered 401 missing identity, even for correctly authenticated clients. internal/dav answers OPTIONS from a static response (compliance headers plus Allow) that reads no user and no storage, so the identity is not needed there. Every method that touches data still requires it, and a test pins that GET, PROPFIND, REPORT, PUT and DELETE keep returning 401 without identity.

Closes #47
Closes #48

Verification

  • go vet ./... clean
  • go test ./... green
  • Both new tests reproduced their defect before the fix (403 and 401 respectively)

@gnacho
gnacho merged commit 879d4eb into main Nov 7, 2026
5 checks passed
@gnacho
gnacho deleted the fix/47-well-known-dav-root branch November 7, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant