From e4af425893b75238b4e536d87e4cbc5abc9e02a1 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 1 May 2013 20:13:51 +0200 Subject: [PATCH] Fix some corner-cases for requests at root path --- radicale/ical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/ical.py b/radicale/ical.py index 97fa956..b1f55c4 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -210,8 +210,8 @@ class Collection(object): # First do normpath and then strip, to prevent access to FOLDER/../ sane_path = posixpath.normpath(path.replace(os.sep, "/")).strip("/") attributes = sane_path.split("/") - if not attributes: - return None + if not sane_path or not attributes: + return [] if not (cls.is_leaf("/".join(attributes)) or path.endswith("/")): attributes.pop()