Compare commits

...

2 Commits

Author SHA1 Message Date
vrancurel 98c9371bbb Merge remote-tracking branch 'origin/development/8.2' into HEAD 2019-11-15 10:35:04 -08:00
vrancurel 079dc0e2ba bf: special treatment for MPU MD5 in md only case
Rclone originally does not handle correctly the MD5 for MPU objects,
because their Etag is structure as "md5chksum-numparts".
Therefore a patch was made to not only transmit an x-amz-meta-md5chksum like
before but also to include an additional x-amz-meta-md5numparts.
This fix will check for this new header and reconstitute the MD5 correcly.
For non-MPU objects the behavior is unchanged and therefore backward
compatible.
2019-11-15 09:58:48 -08:00
1 changed files with 9 additions and 2 deletions

View File

@ -200,15 +200,22 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
const md5 = request.headers['x-amz-meta-md5chksum'] const md5 = request.headers['x-amz-meta-md5chksum']
? new Buffer(request.headers['x-amz-meta-md5chksum'], ? new Buffer(request.headers['x-amz-meta-md5chksum'],
'base64').toString('hex') : null; 'base64').toString('hex') : null;
const numParts = request.headers['x-amz-meta-md5numparts'];
let _md5;
if (numParts === undefined) {
_md5 = md5;
} else {
_md5 = `${md5}-${numParts}`;
}
const versionId = request.headers['x-amz-meta-version-id']; const versionId = request.headers['x-amz-meta-version-id'];
const dataGetInfo = { const dataGetInfo = {
key: objectKey, key: objectKey,
dataStoreName: location, dataStoreName: location,
dataStoreType: locationType, dataStoreType: locationType,
dataStoreVersionId: versionId, dataStoreVersionId: versionId,
dataStoreMD5: md5, dataStoreMD5: _md5,
}; };
return next(null, dataGetInfo, md5); return next(null, dataGetInfo, _md5);
} }
} }
return dataStore(objectKeyContext, cipherBundle, request, size, return dataStore(objectKeyContext, cipherBundle, request, size,