Fix propfind paths

This commit is contained in:
Guillaume Ayoub 2011-06-16 07:49:47 +02:00
parent 00d8b08341
commit ed1ad975a6
2 changed files with 2 additions and 3 deletions

View File

@ -143,8 +143,7 @@ class Application(object):
@staticmethod @staticmethod
def sanitize_uri(uri): def sanitize_uri(uri):
"""Clean URI: unquote and remove /../ to prevent access to other data.""" """Clean URI: unquote and remove /../ to prevent access to other data."""
uri = posixpath.normpath(urllib.unquote(uri)) return posixpath.normpath(urllib.unquote(uri))
return uri
def __call__(self, environ, start_response): def __call__(self, environ, start_response):
"""Manage a request.""" """Manage a request."""

View File

@ -201,7 +201,7 @@ def _propfind_response(path, item, props, user):
response = ET.Element(_tag("D", "response")) response = ET.Element(_tag("D", "response"))
href = ET.Element(_tag("D", "href")) 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) response.append(href)
propstat404 = ET.Element(_tag("D", "propstat")) propstat404 = ET.Element(_tag("D", "propstat"))