fix #205: webdav relative url error

This commit is contained in:
antelle 2016-06-04 18:34:15 +03:00
parent 6ba0808c17
commit f80a9ff1ad
1 changed files with 5 additions and 1 deletions

View File

@ -84,9 +84,13 @@ var StorageWebDav = StorageBase.extend({
that._request(_.defaults({ op: 'Save:delete', method: 'DELETE', path: tmpPath }, saveOpts));
return cb({ revConflict: true }, xhr, stat);
}
var movePath = path;
if (movePath.indexOf('://') < 0) {
movePath = location.href.replace(/[^/]*$/, movePath);
}
that._request(_.defaults({
op: 'Save:move', method: 'MOVE', path: tmpPath, nostat: true,
headers: { Destination: path, 'Overwrite': 'T' }
headers: { Destination: movePath, 'Overwrite': 'T' }
}, saveOpts), function(err) {
if (err) { return cb(err); }
that._request(_.defaults({