Previously, calendar URLs such as /user/calendars/work
would lead to files being written in /user/calendars
and not being checked into Git.
Signed-off-by: Rene Wagner <rw@nelianur.org>
# ``normpath`` should clean malformed and malicious request paths
attributes = posixpath.normpath(self.path.strip("/")).split("/")
if len(attributes) >= 2:
- path = "%s/%s" % (attributes[0], attributes[1])
+ path = '/'.join(attributes[:-1])
if not path in CollectionHTTPHandler.collections:
CollectionHTTPHandler.collections[path] = webdav.Collection(path)
return CollectionHTTPHandler.collections[path]