diff --git a/source/vibedav/base.d b/source/vibedav/base.d index 9b848b5..aaa87b4 100644 --- a/source/vibedav/base.d +++ b/source/vibedav/base.d @@ -93,7 +93,10 @@ unittest { assert(path.toString == "/base/file.txt"); } - +string urlToString(URL url) { + string name = url.path.toNativeString; + return name.replace(" ", "%20"); +} struct DavReport { string name; @@ -326,7 +329,7 @@ class Dav : IDav { list["getcontentlength:DAV:"] = true; list["getcontenttype:DAV:"] = true; list["getetag:DAV:"] = true; - list["lastmodified:DAV:"] = true; + list["getlastmodified:DAV:"] = true; list["resourcetype:DAV:"] = true; return list; diff --git a/source/vibedav/davresource.d b/source/vibedav/davresource.d index a5757ea..47cc159 100644 --- a/source/vibedav/davresource.d +++ b/source/vibedav/davresource.d @@ -631,7 +631,7 @@ class DavResource : IDavResourcePluginHub { DavProp[][int] result; - item[`d:href`] = url.path.toNativeString; + item[`d:href`] = urlToString(url); foreach_reverse(key; props.keys) { DavProp p; @@ -682,7 +682,7 @@ class DavResource : IDavResourcePluginHub { string propPatch(DavProp document) { string description; string result = ``; - result ~= `` ~ url.toString ~ ``; + result ~= `` ~ urlToString(url) ~ ``; auto updateList = [document].getTagChilds("propertyupdate"); @@ -717,8 +717,6 @@ class DavResource : IDavResourcePluginHub { result ~= ``; - string strUrl = url.toString; - return result; }