Doc Webdav: Don't send both ETag and Location after PUT

An ETag should refer to the requested uri, so a Location header will
render it invalid anyway. Gnome's evolution has an if-else block that
first checks ETag and then Location.

bzr revid: p_christ@hol.gr-20100812111025-xoilqlb956moovgv
This commit is contained in:
P. Christeas 2010-08-12 14:10:25 +03:00
parent 5df0b8cf8c
commit bcba71f779
1 changed files with 8 additions and 8 deletions

View File

@ -221,14 +221,14 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler):
# note that we have allowed for > 2 elems
if location:
headers['Location'] = location
try:
if not etag:
etag = dc.get_prop(location or uri, "DAV:", "getetag")
if etag:
headers['ETag'] = str(etag)
except Exception:
pass
else:
try:
if not etag:
etag = dc.get_prop(location or uri, "DAV:", "getetag")
if etag:
headers['ETag'] = str(etag)
except Exception:
pass
self.send_body(None, '201', 'Created', '', headers=headers)