diff --git a/radicale/sharing/__init__.py b/radicale/sharing/__init__.py index 0d0ebe8a..88874d31 100644 --- a/radicale/sharing/__init__.py +++ b/radicale/sharing/__init__.py @@ -647,9 +647,19 @@ class BaseSharing: if result: result['PathMapped'] = path.replace(parent_path, result['PathMapped']) logger.trace("sharing/map/resolver: PathMapped=%r Permissions=%r by parent_path=%r", result['PathMapped'], result['Permissions'], parent_path) - else: - logger.trace("sharing/map/resolver: not found") - return None + + if not result and not path.endswith("/"): + # assume collection path with missing trailing / + path_with_trailing_slash = path + "/" + logger.trace("sharing/map/resolver: check path having '/' appended: %r", path_with_trailing_slash) + result = self.database_get_sharing( + ShareType="map", + PathOrToken=path_with_trailing_slash, + OnlyEnabled=False, + User=user) + if result: + path = path_with_trailing_slash + logger.trace("sharing/map/resolver: PathMapped=%r Permissions=%r by path_with_trailing_slash=%r", result['PathMapped'], result['Permissions'], path_with_trailing_slash) if result: if result['EnabledByOwner'] is not True: @@ -667,6 +677,7 @@ class BaseSharing: logger.info("sharing/%s: resolved path %r->%r, user %r->%r, Permissions=%r Conversion=%r", "map", result['PathOrToken'], result['PathMapped'], user, result['Owner'], result['Permissions'], result['Conversion']) return result + logger.trace("sharing/map/resolver: not found") return None else: logger.trace("sharing/map: not active")