Explorar el Código

Fix propfind paths

Guillaume Ayoub hace 14 años
padre
commit
de0643e741
Se han modificado 2 ficheros con 2 adiciones y 3 borrados
  1. 1 2
      radicale/__init__.py
  2. 1 1
      radicale/xmlutils.py

+ 1 - 2
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."""

+ 1 - 1
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"))