mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-29 04:08:54 +03:00
lock token should be sent via webdav only for token lock type
to be able to modify a locked file using token lock, we must sent it with webdav requests this must not be sent if the file is locked but the lock type is not a token lock Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
202be8a081
commit
c77562022d
2 changed files with 4 additions and 2 deletions
|
@ -328,7 +328,8 @@ void PropagateUploadFileNG::finishUpload()
|
|||
|
||||
const auto fileSize = _fileToUpload._size;
|
||||
headers[QByteArrayLiteral("OC-Total-Length")] = QByteArray::number(fileSize);
|
||||
if (_item->_locked == SyncFileItem::LockStatus::LockedItem) {
|
||||
if (_item->_lockOwnerType == SyncFileItem::LockOwnerType::TokenLock &&
|
||||
_item->_locked == SyncFileItem::LockStatus::LockedItem) {
|
||||
headers[QByteArrayLiteral("If")] = (QLatin1String("<") + propagator()->account()->davUrl().toString() + _fileToUpload._file + "> (<opaquelocktoken:" + _item->_lockToken.toUtf8() + ">)").toUtf8();
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,8 @@ void PropagateUploadFileV1::startNextChunk()
|
|||
|
||||
QString path = _fileToUpload._file;
|
||||
|
||||
if (_item->_locked == SyncFileItem::LockStatus::LockedItem) {
|
||||
if (_item->_lockOwnerType == SyncFileItem::LockOwnerType::TokenLock &&
|
||||
_item->_locked == SyncFileItem::LockStatus::LockedItem) {
|
||||
headers[QByteArrayLiteral("If")] = (QLatin1String("<") + propagator()->account()->davUrl().toString() + _fileToUpload._file + "> (<opaquelocktoken:" + _item->_lockToken.toUtf8() + ">)").toUtf8();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue