Merge pull request #5 from a1ezzz/return_codes

webdav3/client.py: Client.mkdir now accepts 201 HTTP-code
This commit is contained in:
Evgeny Ezhov 2018-05-10 14:27:12 +03:00 committed by GitHub
commit c6ec44e479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -284,7 +284,7 @@ class Client(object):
More information you can find by link http://webdav.org/specs/rfc4918.html#METHOD_MKCOL
:param remote_path: path to directory
:return: True if request executed with code 200 and False otherwise.
:return: True if request executed with code 200 or 201 and False otherwise.
"""
directory_urn = Urn(remote_path, directory=True)
@ -292,7 +292,7 @@ class Client(object):
raise RemoteParentNotFound(directory_urn.path())
response = self.execute_request(action='mkdir', path=directory_urn.quote())
return response.status_code == 200
return response.status_code in (200, 201)
@wrap_connection_error
def download_from(self, buff, remote_path):