From 91a463981f677663683a6a427e4521d539f15106 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 11 Oct 2023 15:36:32 +0800 Subject: [PATCH] Provide full url for chunked upload destination header Signed-off-by: Claudio Cambra --- src/libsync/propagateuploadng.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 2330c5c647d72..437fd7adce875 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -360,10 +360,12 @@ void PropagateUploadFileNG::startNextChunk() return; } - auto headers = PropagateUploadFileCommon::headers(); + QMap headers; headers["OC-Chunk-Offset"] = QByteArray::number(_sent); - const auto destination = QDir::cleanPath(propagator()->account()->davUrl().path() + propagator()->fullRemotePath(_fileToUpload._file)); + 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(); _sent += _currentChunkSize;