From 870dbe3d127e8cba178bd745ff1a39391c681f6b Mon Sep 17 00:00:00 2001 From: Szabo Bogdan Date: Sun, 3 May 2015 19:32:35 +0300 Subject: [PATCH] Minor fixes --- source/vibedav/base.d | 7 +++++-- source/vibedav/davresource.d | 6 ++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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; }