ChunkingNG: Use the 'If' header
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 20 Oct 2016 09:16:06 +0000 (11:16 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 20 Oct 2016 09:16:06 +0000 (11:16 +0200)
As discussed in https://github.com/owncloud/core/pull/26368

src/libsync/propagateuploadng.cpp

index 5e43be633ff699114ff70126f5d92c53e3aa704a..7b632233dd4809b3669a65292cee4da0cba86350 100644 (file)
@@ -210,11 +210,10 @@ void PropagateUploadFileNG::startNextChunk()
             + _propagator->_remoteFolder + _item->_file;
         auto headers = PropagateUploadFileCommon::headers();
 
-        // Rename the If-Match header to "OC-If-Destination-Match"
         // "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["OC-If-Destination-Match"] = ifMatch;
+            headers["If"] =  "<" + destination.toUtf8() + "> ([" + ifMatch + "])";
         }
         if (!_transmissionChecksumType.isEmpty()) {
             headers[checkSumHeaderC] = makeChecksumHeader(