diff --git a/src/libsync/propagateupload.h b/src/libsync/propagateupload.h index e12e4500a..33db43f29 100644 --- a/src/libsync/propagateupload.h +++ b/src/libsync/propagateupload.h @@ -410,6 +410,7 @@ private: [[nodiscard]] QUrl chunkUploadFolderUrl() const; [[nodiscard]] QUrl chunkUrl(const int chunk) const; + [[nodiscard]] QByteArray destinationHeader() const; void startNewUpload(); void startNextChunk(); diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 437fd7adc..e477cb830 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -85,6 +85,14 @@ QUrl PropagateUploadFileNG::chunkUrl(const int chunk) const */ +QByteArray PropagateUploadFileNG::destinationHeader() const +{ + const auto davUrl = Utility::trailingSlashPath(propagator()->account()->davUrl().toString()); + const auto remotePath = Utility::noLeadingSlashPath(propagator()->fullRemotePath(_fileToUpload._file)); + const auto destination = QString(davUrl + remotePath); + return destination.toUtf8(); +} + void PropagateUploadFileNG::doStartUpload() { propagator()->_activeJobList.append(this); @@ -362,11 +370,7 @@ void PropagateUploadFileNG::startNextChunk() QMap headers; headers["OC-Chunk-Offset"] = QByteArray::number(_sent); - - const auto davUrl = Utility::trailingSlashPath(propagator()->account()->davUrl().toString()); - const auto remotePath = Utility::noLeadingSlashPath(propagator()->fullRemotePath(_fileToUpload._file)); - const auto destination = QString(davUrl + remotePath); - headers["Destination"] = destination.toUtf8(); + headers["Destination"] = destinationHeader(); _sent += _currentChunkSize; const auto url = chunkUrl(_currentChunk);