diff options
author | cos <cos> | 2017-01-21 17:59:04 +0100 |
---|---|---|
committer | cos <cos> | 2017-05-20 08:15:25 +0200 |
commit | 488aff467b047108ba655475b333a4134908dbeb (patch) | |
tree | c71b1af9d117c2698b18ddb8b083abab2491be2a /contrib | |
parent | 5aa7a0962a2728e6b2164c4531d3995b33cb71b8 (diff) | |
download | calcurse-fix/add_missing_depth_header.zip |
|cos|: Could you please try that?fix/add_missing_depth_header
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/caldav/calcurse-caldav.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 = ('<?xml version="1.0" encoding="utf-8" ?>' '<C:calendar-multiget xmlns:D="DAV:" ' ' xmlns:C="urn:ietf:params:xml:ns:caldav">' @@ -146,13 +147,14 @@ def get_etags(conn, hrefs=[]): body += '<D:href>{}</D:href>'.format(href) body += '</C:calendar-multiget>' else: + headers = {'Depth': '1'} body = ('<?xml version="1.0" encoding="utf-8" ?>' '<C:calendar-query xmlns:D="DAV:" ' ' xmlns:C="urn:ietf:params:xml:ns:caldav">' '<D:prop><D:getetag /></D:prop>' '<C:filter><C:comp-filter name="VCALENDAR" /></C:filter>' '</C:calendar-query>') - 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) |