diff --git a/README.rst b/README.rst index e2d0d21..f23e81c 100644 --- a/README.rst +++ b/README.rst @@ -34,6 +34,7 @@ Release Notes * Added Docker Web DAV for CI * Changed HEAD to GET method for 'check' request due of not all servers support HEAD by request of https://github.com/danieleTrimarchi * Removed a costy is_dir-check on obvious directories to speed up a pull by https://github.com/jolly-jump + * Added an option to disable check in case WebDAV server is not support it by request of https://github.com/dzhuang **Version 0.12 - 21.06.2019** * Added depth argument in copy method in client.py by https://github.com/JesperHakansson diff --git a/webdav3/client.py b/webdav3/client.py index 3b7a34a..fecc5d4 100644 --- a/webdav3/client.py +++ b/webdav3/client.py @@ -274,11 +274,13 @@ class Client(object): :return: True if resource is exist or False otherwise """ - if not self.webdav.do_check: + if self.webdav.disable_check: return True urn = Urn(remote_path) try: response = self.execute_request(action='check', path=urn.quote()) + except RemoteResourceNotFound: + return False except ResponseErrorCode: return False diff --git a/webdav3/connection.py b/webdav3/connection.py index a90854a..f24593c 100644 --- a/webdav3/connection.py +++ b/webdav3/connection.py @@ -22,7 +22,7 @@ class WebDAVSettings(ConnectionSettings): ns = "webdav:" prefix = "webdav_" keys = {'hostname', 'login', 'password', 'token', 'root', 'cert_path', 'key_path', 'recv_speed', 'send_speed', - 'verbose', 'do_check'} + 'verbose', 'disable_check'} hostname = None login = None @@ -34,7 +34,7 @@ class WebDAVSettings(ConnectionSettings): recv_speed = None send_speed = None verbose = None - do_check = False + disable_check = False def __init__(self, options):