Revert "fix #1154: relative Destination header in WebDAV MOVE"

This reverts commit cbbf5f83

fix #1259
This commit is contained in:
antelle 2019-09-12 20:09:45 +02:00
parent 1b64dd6d56
commit ef7ae9ada9
1 changed files with 9 additions and 4 deletions

View File

@ -178,10 +178,15 @@ const StorageWebDav = StorageBase.extend({
return cb({ revConflict: true }, xhr, stat);
}
let movePath = path;
if (movePath.includes('://')) {
movePath = movePath.replace(/^\w+:\/\/[^\/]+/, '');
} else if (!movePath.startsWith('/')) {
movePath = location.pathname.replace(/[^/]*$/, movePath);
if (movePath.indexOf('://') < 0) {
if (movePath.indexOf('/') === 0) {
movePath =
location.protocol + '//' + location.host + movePath;
} else {
movePath = location.href
.replace(/\?(.*)/, '')
.replace(/[^/]*$/, movePath);
}
}
that._request(
_.defaults(