From e76b96c9ff162ada42863d4ec2d739bf874af113 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 8 Dec 2016 09:37:34 +0100 Subject: calcurse-caldav: Specify depth in the initial request For the initial calendar-query request, set the Depth header to 1. This is required because according to RFC 4791, the depth value defaults to 0 if no header is specified. Fixes GitHub issue #38. Signed-off-by: Lukas Fleischer --- contrib/caldav/calcurse-caldav.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/caldav/calcurse-caldav.py b/contrib/caldav/calcurse-caldav.py index 5c028bf..1db4740 100755 --- a/contrib/caldav/calcurse-caldav.py +++ b/contrib/caldav/calcurse-caldav.py @@ -138,6 +138,7 @@ def remote_query(conn, cmd, path, additional_headers, body): def get_etags(conn, hrefs=[]): if len(hrefs) > 0: + headers = {} body = ('' '' @@ -146,13 +147,14 @@ def get_etags(conn, hrefs=[]): body += '{}'.format(href) body += '' else: + headers = {'Depth': '1'} body = ('' '' '' '' '') - headers, body = remote_query(conn, "REPORT", path, {}, body) + headers, body = remote_query(conn, "REPORT", path, headers, body) if not headers: return {} root = etree.fromstring(body) -- cgit v1.2.3-70-g09d2