From ed1ad975a6d3ca053e7fda253efd37c43b335a9c Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Thu, 16 Jun 2011 07:49:47 +0200 Subject: [PATCH] Fix propfind paths --- radicale/__init__.py | 3 +-- radicale/xmlutils.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 3215af7..6bbdc5a 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -143,8 +143,7 @@ class Application(object): @staticmethod def sanitize_uri(uri): """Clean URI: unquote and remove /../ to prevent access to other data.""" - uri = posixpath.normpath(urllib.unquote(uri)) - return uri + return posixpath.normpath(urllib.unquote(uri)) def __call__(self, environ, start_response): """Manage a request.""" diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index f02175b..4ea7eb2 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -201,7 +201,7 @@ def _propfind_response(path, item, props, user): response = ET.Element(_tag("D", "response")) href = ET.Element(_tag("D", "href")) - href.text = item.url if is_calendar else path + item.name + href.text = item.url if is_calendar else "%s/%s" % (path, item.name) response.append(href) propstat404 = ET.Element(_tag("D", "propstat"))