Fix get requests for whole calendar
This commit is contained in:
parent
72f3af9ab9
commit
091d89889d
@ -154,7 +154,8 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
|
|||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
"""Manage GET request."""
|
"""Manage GET request."""
|
||||||
self.do_HEAD()
|
self.do_HEAD()
|
||||||
self.wfile.write(self._answer)
|
if self._answer:
|
||||||
|
self.wfile.write(self._answer)
|
||||||
|
|
||||||
@check_rights
|
@check_rights
|
||||||
def do_HEAD(self):
|
def do_HEAD(self):
|
||||||
@ -170,6 +171,7 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
|
|||||||
headers=self._calendar.headers, items=items)
|
headers=self._calendar.headers, items=items)
|
||||||
etag = item.etag
|
etag = item.etag
|
||||||
else:
|
else:
|
||||||
|
self._answer = None
|
||||||
self.send_response(client.GONE)
|
self.send_response(client.GONE)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
@ -52,7 +52,8 @@ def _response(code):
|
|||||||
|
|
||||||
def name_from_path(path):
|
def name_from_path(path):
|
||||||
"""Return Radicale item name from ``path``."""
|
"""Return Radicale item name from ``path``."""
|
||||||
return path.split("/")[-1]
|
path_parts = path.strip("/").split("/")
|
||||||
|
return path_parts[-1] if len(path_parts) > 2 else None
|
||||||
|
|
||||||
|
|
||||||
def delete(path, calendar):
|
def delete(path, calendar):
|
||||||
|
Loading…
Reference in New Issue
Block a user