diff --git a/radicale/storage.py b/radicale/storage.py index 0039f11..f0de7cc 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -497,8 +497,9 @@ class Collection(BaseCollection): continue child_filesystem_path = path_to_filesystem(filesystem_path, href) if os.path.isdir(child_filesystem_path): + child_path = posixpath.join(path, href) child_principal = len(attributes) == 0 - yield cls(child_filesystem_path, child_principal) + yield cls(child_path, child_principal) @classmethod def create_collection(cls, href, collection=None, props=None): diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 6f763a0..8d06dbc 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -20,6 +20,7 @@ Radicale tests with simple requests. """ import logging +import posixpath import shutil import tempfile @@ -188,6 +189,21 @@ class BaseRequests: status, headers, answer = self.request("GET", "/event1.ics") assert status == 404 + def test_propfind(self): + calendar_path = "/calendar.ics/" + self.request("MKCALENDAR", calendar_path) + event = get_file_content("event1.ics") + event_path = posixpath.join(calendar_path, "event.ics") + self.request("PUT", event_path, event) + status, headers, answer = self.request("PROPFIND", "/", HTTP_DEPTH="1") + assert status == 207 + assert "href>/%s%s%s