Modified WebDav save destination to work correctly with relative and root paths, removing any URL paramaters

This commit is contained in:
Tim Stallard 2016-11-13 21:39:05 +00:00
parent 52701af6d6
commit c89ba02466
1 changed files with 5 additions and 1 deletions

View File

@ -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,