From c89ba02466d077bf7893db2fc74980cb4f1835ec Mon Sep 17 00:00:00 2001 From: Tim Stallard Date: Sun, 13 Nov 2016 21:39:05 +0000 Subject: [PATCH] Modified WebDav save destination to work correctly with relative and root paths, removing any URL paramaters --- app/scripts/storage/storage-webdav.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/scripts/storage/storage-webdav.js b/app/scripts/storage/storage-webdav.js index 6d0a1a9e..03320cf2 100644 --- a/app/scripts/storage/storage-webdav.js +++ b/app/scripts/storage/storage-webdav.js @@ -86,7 +86,11 @@ var StorageWebDav = StorageBase.extend({ } var movePath = path; if (movePath.indexOf('://') < 0) { - movePath = location.href.replace(/[^/]*$/, movePath); + if (movePath.indexOf('/') === 0) { + movePath = location.protocol + '//' + location.host + movePath; + } else { + movePath = location.href.replace(/\?(.*)/, '').replace(/[^/]*$/, movePath); + } } that._request(_.defaults({ op: 'Save:move', method: 'MOVE', path: tmpPath, nostat: true,