mirror of
https://github.com/Kozea/Radicale.git
synced 2025-09-12 20:30:57 +00:00
Clean owner-less calendars support (fixes #254)
This commit is contained in:
parent
6c65cc1539
commit
5673444ba7
3 changed files with 7 additions and 18 deletions
|
@ -175,14 +175,9 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
|
|||
# ``self.path`` must be something like a posix path
|
||||
# ``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])
|
||||
elif len(attributes) == 1: # no owner
|
||||
path = attributes[0]
|
||||
else:
|
||||
return
|
||||
|
||||
return ical.Calendar(path)
|
||||
if attributes:
|
||||
path = "/".join(attributes[:min(len(attributes), 2)])
|
||||
return ical.Calendar(path)
|
||||
|
||||
def _decode(self, text):
|
||||
"""Try to decode text according to various parameters."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue