diff options
| author | Harry (OpenERP) <hmo@tinyerp.com> | 2010-11-12 15:18:36 +0530 |
|---|---|---|
| committer | Harry (OpenERP) <hmo@tinyerp.com> | 2010-11-12 15:18:36 +0530 |
| commit | ca33cf5313aa527d7e619b8c2fb9159ce20af108 (patch) | |
| tree | c2247df51f09f05c340d35f3ccf392016668297d /addons/document_webdav/webdav_server.py | |
| parent | 515b856d55203f813a324bb7a6cfa2ba11695d39 (diff) | |
| parent | d3b79b05fcbcbd0da299c09f96edc4d1ac698cc0 (diff) | |
[MERGE]
bzr revid: hmo@tinyerp.com-20101112094836-qy4536d3tjvw04xc
Diffstat (limited to 'addons/document_webdav/webdav_server.py')
| -rw-r--r-- | addons/document_webdav/webdav_server.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py index df2c4a871f6..4e10c84b8f5 100644 --- a/addons/document_webdav/webdav_server.py +++ b/addons/document_webdav/webdav_server.py @@ -36,10 +36,13 @@ from service.websrv_lib import HTTPDir, FixSendError, HttpOptions from BaseHTTPServer import BaseHTTPRequestHandler import urlparse import urllib +import re from string import atoi,split from DAV.errors import * # from DAV.constants import DAV_VERSION_1, DAV_VERSION_2 +khtml_re = re.compile(r' KHTML/([0-9\.]+) ') + def OpenDAVConfig(**kw): class OpenDAV: def __init__(self, **kw): @@ -131,6 +134,16 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): # the BufferingHttpServer will send Connection: close , while # the BaseHTTPRequestHandler will only accept int code. # workaround both of them. + if self.command == 'PROPFIND' and int(code) == 404: + kh = khtml_re.search(self.headers.get('User-Agent','')) + if kh and (kh.group(1) < '4.5'): + # There is an ugly bug in all khtml < 4.5.x, where the 404 + # response is treated as an immediate error, which would even + # break the flow of a subsequent PUT request. At the same time, + # the 200 response (rather than 207 with content) is treated + # as "path not exist", so we send this instead + # https://bugs.kde.org/show_bug.cgi?id=166081 + code = 200 BaseHTTPRequestHandler.send_response(self, int(code), message) def send_header(self, key, value): @@ -216,7 +229,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): try: location = dc.put(uri, body, ct) except DAV_Error, (ec,dd): - self._logger.warning("Cannot PUT to %s: %s", uri, dd, exc_info=True) + self.log_error("Cannot PUT to %s: %s", uri, dd) return self.send_status(ec) headers = {} |
