Fix the iCal support (now tested with iCal, Lightning, Evolution)

This commit is contained in:
Guillaume Ayoub
2011-07-01 17:49:01 +02:00
parent d17e8fa990
commit e9ad9b1716
3 changed files with 14 additions and 14 deletions

View File

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