Skip to content

Commit 65c45d8

Browse files
committed
use standard way to find teh checkum type and really send it to server
will fix missing checksum for bulk upload will ensure consistent behavior between bulk upload, plain old upload and chunked upload Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
1 parent 28710b0 commit 65c45d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libsync/bulkpropagatorjob.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void BulkPropagatorJob::doStartUpload(SyncFileItemPtr item,
204204

205205
const auto remotePath = propagator()->fullRemotePath(fileToUpload._file);
206206

207-
currentHeaders["X-File-MD5"] = transmissionChecksumHeader;
207+
currentHeaders[checkSumHeaderC] = transmissionChecksumHeader;
208208

209209
BulkUploadItem newUploadFile{propagator()->account(), item, fileToUpload,
210210
remotePath, fileToUpload._path,
@@ -295,7 +295,7 @@ void BulkPropagatorJob::slotComputeTransmissionChecksum(SyncFileItemPtr item,
295295
{
296296
// Compute the transmission checksum.
297297
const auto computeChecksum = new ComputeChecksum(this);
298-
const auto checksumType = uploadChecksumEnabled() ? "MD5" : "";
298+
const auto checksumType = uploadChecksumEnabled() ? propagator()->account()->capabilities().preferredUploadChecksumType() : "";
299299
computeChecksum->setChecksumType(checksumType);
300300

301301
connect(computeChecksum, &ComputeChecksum::done, this, [this, item, fileToUpload] (const QByteArray &contentChecksumType, const QByteArray &contentChecksum) {

0 commit comments

Comments
 (0)