Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gedaiu committed May 3, 2015
1 parent 8c63948 commit 870dbe3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 5 additions & 2 deletions source/vibedav/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions source/vibedav/davresource.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -682,7 +682,7 @@ class DavResource : IDavResourcePluginHub {
string propPatch(DavProp document) {
string description;
string result = `<?xml version="1.0" encoding="utf-8" ?><d:multistatus xmlns:d="DAV:"><d:response>`;
result ~= `<d:href>` ~ url.toString ~ `</d:href>`;
result ~= `<d:href>` ~ urlToString(url) ~ `</d:href>`;

auto updateList = [document].getTagChilds("propertyupdate");

Expand Down Expand Up @@ -717,8 +717,6 @@ class DavResource : IDavResourcePluginHub {

result ~= `</d:response></d:multistatus>`;

string strUrl = url.toString;

return result;
}

Expand Down

0 comments on commit 870dbe3

Please sign in to comment.