From 165ade9c3f8c8618a7e7727bc0e9b12924650dbc Mon Sep 17 00:00:00 2001 From: Ildar Gafurov Date: Tue, 8 May 2018 23:07:13 +0300 Subject: [PATCH] webdav3/client.py: Client.mkdir now accepts 201 HTTP-code --- webdav3/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webdav3/client.py b/webdav3/client.py index a72dc36..afc7d57 100644 --- a/webdav3/client.py +++ b/webdav3/client.py @@ -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):