calcurse-caldav: Handle missing ETag gracefully
This was partly fixed by 475c341 (calcurse-caldav: Fix late retrieval of ETag, 2016-01-25). However, the case where the server does not return ETag after creating a new item still wasn't handled properly. This patch hopefully addresses this and also makes sure that the ETag header is matched case-insensitively. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
4fff8ae4fe
commit
bfafec3ebf
@ -192,7 +192,10 @@ def push_object(conn, objhash):
|
|||||||
if not headers:
|
if not headers:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
etag = [header[1] for header in headers if header[0] == 'ETag'][0]
|
etag = None
|
||||||
|
headerdict = dict((key.lower(), value) for key, value in headers)
|
||||||
|
if 'etag' in headerdict:
|
||||||
|
etag = headerdict['etag']
|
||||||
while not etag:
|
while not etag:
|
||||||
hrefmap = get_hrefmap(conn, objhash)
|
hrefmap = get_hrefmap(conn, objhash)
|
||||||
if len(hrefmap.keys()) > 0:
|
if len(hrefmap.keys()) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user