diff options
author | rfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-01-28 05:59:30 +0000 |
---|---|---|
committer | rfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-01-28 05:59:30 +0000 |
commit | 14d8c92fe978efd7986beb791a6df0abf7436d2f (patch) | |
tree | 414bca9ae72c780d48aeff9368d46a5dffc3d8ce /fs/contrib | |
parent | d8638bb08ef2f374546249987e55f6edc3c08bc6 (diff) | |
download | pyfilesystem-14d8c92fe978efd7986beb791a6df0abf7436d2f.tar.gz |
DAVFS: never issue PROPFIND with empty body.
This enumerates all properties and their values and can be very expensive.
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@618 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/contrib')
-rw-r--r-- | fs/contrib/davfs/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/contrib/davfs/__init__.py b/fs/contrib/davfs/__init__.py index 133f938..7c73ffb 100644 --- a/fs/contrib/davfs/__init__.py +++ b/fs/contrib/davfs/__init__.py @@ -107,7 +107,8 @@ class DAVFS(FS): # Check that the server speaks WebDAV, and normalize the URL # after any redirects have been followed. self.url = url - resp = self._request("/","PROPFIND","",{"Depth":"0"}) + pf = propfind(prop="<prop xmlns='DAV:'><resourcetype /></prop>") + resp = self._request("/","PROPFIND",pf.render(),{"Depth":"0"}) try: if resp.status == 404: raise ResourceNotFoundError("/",msg="root url gives 404") @@ -329,7 +330,8 @@ class DAVFS(FS): return RemoteFileBuffer(self,path,mode,contents) def exists(self,path): - response = self._request(path,"PROPFIND","",{"Depth":"0"}) + pf = propfind(prop="<prop xmlns='DAV:'><resourcetype /></prop>") + response = self._request(path,"PROPFIND",pf.render(),{"Depth":"0"}) response.close() if response.status == 207: return True |