Open ffoxin opened 9 years ago
I believe two other spots need this:
@@ -83,7 +84,7 @@
port = 443 if protocol == 'https' else 80
self.baseurl = '{0}://{1}:{2}'.format(protocol, host, port)
if path:
- self.baseurl = '{0}/{1}'.format(self.baseurl, path)
+ self.baseurl = '{0}/{1}'.format(self.baseurl, quote(path))
self.cwd = '/'
self.session = requests.session()
self.session.verify = verify_ssl
@@ -114,10 +115,10 @@
return response
def _get_url(self, path):
- path = str(path).strip()
+ path = quote(str(path).strip())
if path.startswith('/'):
return self.baseurl + path
- return "".join((self.baseurl, self.cwd, path))
+ return "".join((self.baseurl, quote(self.cwd), path))
It is necessary to escape WebDav path before requesting it.
Server path can contain some charaters that should be escaped in url (i.e. space character).