diff --git a/radicale/__init__.py b/radicale/__init__.py index 573193d..edd7500 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -247,9 +247,8 @@ class Application: # Mask passwords mask_passwords = self.configuration.getboolean( "logging", "mask_passwords") - authorization = request_environ.get( - "HTTP_AUTHORIZATION", "").startswith("Basic") - if mask_passwords and authorization: + authorization = request_environ.get("HTTP_AUTHORIZATION", "") + if mask_passwords and authorization.startswith("Basic"): request_environ["HTTP_AUTHORIZATION"] = "Basic **masked**" return request_environ diff --git a/radicale/storage.py b/radicale/storage.py index 7bda7e0..7b6b09f 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -810,9 +810,7 @@ class Collection(BaseCollection): def discover(cls, path, depth="0"): # Path should already be sanitized sane_path = sanitize_path(path).strip("/") - attributes = sane_path.split("/") - if not attributes[0]: - attributes.pop() + attributes = sane_path.split("/") if sane_path else [] folder = cls._get_collection_root_folder() # Create the root collection