Fix wrong encoding when specifying extra header with if-match path
authorDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Sun, 2 Feb 2020 12:35:16 +0000 (13:35 +0100)
committerDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Sun, 2 Feb 2020 12:35:16 +0000 (13:35 +0100)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
src/libsync/propagateuploadng.cpp

index 7dae923cb4af31231a533178af5853926b658250..bb93713ceee75db36eb471f5fa04f60cb2304947 100644 (file)
@@ -286,7 +286,7 @@ void PropagateUploadFileNG::startNextChunk()
         // "If-Match applies to the source, but we are interested in comparing the etag of the destination
         auto ifMatch = headers.take("If-Match");
         if (!ifMatch.isEmpty()) {
-            headers["If"] = "<" + destination.toUtf8() + "> ([" + ifMatch + "])";
+            headers["If"] = "<" + QUrl::toPercentEncoding(destination, "/") + "> ([" + ifMatch + "])";
         }
         if (!_transmissionChecksumHeader.isEmpty()) {
             qCInfo(lcPropagateUpload) << destination << _transmissionChecksumHeader;