Discovery never tries the address typed, so a server under a sub-path without a root /.well-known cannot connect #23
Labels
No labels
bug
documentation
enhancement
performance
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-dav#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo-dav at
97abc9779, reading discovery and running Test against a fake server that only answers under a sub-path.Server.principal()asks for the principal at/.well-known/{carddav|caldav}and at/, both absolute paths, sourljoinresolves them against the host's root and the path in the configured address is never used. A DAV server installed under a sub-path (Baïkal at/dav.php/, SOGo at/SOGo/dav/, Nextcloud or Radicale behind a prefix) whose web server has no redirect at the root cannot be connected at all, even when the person types the exact DAV endpoint.src/postulo_dav/dav.py:126-137(Server.principal,for start in (f"/.well-known/{well_known}", "/"):); the address is described atsrc/postulo_dav/sync.py:231-241(config_fields, "The server's root, e.g. https://cloud.example.org. Postulo finds the address book and calendar homes from there.") and inREADME.md:33.https://example.org/baikal/dav.php/. Test sends PROPFIND to/.well-known/carddavand to/onexample.org, both answer 404, and the result is "DavError: the server names no principal for carddav". No request is made under/baikal/. Reproduced with a mock transport that answers 404 everywhere and logs paths: the only two requests were/.well-known/carddavand/.principal(), try the configured address itself first (self.base, a relative start), then/.well-known/…, then/. Reword the help text to say that either the server's root or its DAV address will do.Done when
tests/test_dav.pywith a fake server that serves the DAV tree only under a sub-path and answers 404 at the root and at/.well-known/, asserting that Test with the sub-path address finds both collections.Fixed by pull request #35, merged as
fb8bbd7ae.