diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 423eacdd6bb79..261b6e5dd3820 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -25,6 +25,8 @@ #include #include +using namespace Qt::StringLiterals; + namespace OCC { constexpr auto relativeUploadsPath = "remote.php/dav/uploads/"; @@ -80,9 +82,9 @@ 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 remotePath = QUrl::toPercentEncoding(Utility::noLeadingSlashPath(propagator()->fullRemotePath(_fileToUpload._file)), "/"_ba); const auto destination = QString(davUrl + remotePath); - return QUrl::toPercentEncoding(destination, "/"); + return destination.toUtf8(); } void PropagateUploadFileNG::doStartUpload() diff --git a/test/testchunkingng.cpp b/test/testchunkingng.cpp index 636729bf71294..9edac17942c4f 100644 --- a/test/testchunkingng.cpp +++ b/test/testchunkingng.cpp @@ -151,6 +151,7 @@ private slots: QVERIFY(destinationHeader.contains("SQ-0.5%25BF-150")); QVERIFY(destinationHeader.contains("/A/SQ-0.5%25BF-150/")); QVERIFY(!destinationHeader.contains("%2F")); + QVERIFY(destinationHeader.startsWith("http://")); } // Test resuming when there's a confusing chunk added