From bcba71f7798296a11d232c5d2b91bfe91405a015 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 12 Aug 2010 14:10:25 +0300 Subject: [PATCH] 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 --- addons/document_webdav/webdav_server.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py index 3cda2ccc6fe..8a83e25456d 100644 --- a/addons/document_webdav/webdav_server.py +++ b/addons/document_webdav/webdav_server.py @@ -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)