diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-08-12 14:10:25 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-08-12 14:10:25 +0300 |
| commit | bcba71f7798296a11d232c5d2b91bfe91405a015 (patch) | |
| tree | b23bc112524c2ea81905f291696e636d37a673c3 /addons/document_webdav | |
| parent | 5df0b8cf8cc0ca5eb6af8428e5ba6a8c4bb38f34 (diff) | |
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
Diffstat (limited to 'addons/document_webdav')
| -rw-r--r-- | addons/document_webdav/webdav_server.py | 16 |
1 files 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) |
