Compare commits

...

1 Commits

Author SHA1 Message Date
Bennett Buchanan 9e8e80991b bugfix: ZENKO-623 Make MD5 optional for backbeat 2018-07-13 17:38:21 -07:00
1 changed files with 3 additions and 7 deletions

View File

@ -237,12 +237,6 @@ function putData(request, response, bucketInfo, objMd, log, callback) {
log.error(errMessage); log.error(errMessage);
return callback(errors.BadRequest.customizeDescription(errMessage)); return callback(errors.BadRequest.customizeDescription(errMessage));
} }
const contentMD5 = request.headers['content-md5'];
if (contentMD5 === undefined) {
errMessage = 'bad request: missing content-md5 header';
log.error(errMessage);
return callback(errors.BadRequest.customizeDescription(errMessage));
}
const context = { const context = {
bucketName: request.bucketName, bucketName: request.bucketName,
owner: canonicalID, owner: canonicalID,
@ -270,7 +264,9 @@ function putData(request, response, bucketInfo, objMd, log, callback) {
}); });
return callback(err); return callback(err);
} }
if (contentMD5 !== md5) { // Optional param if replicating from source cloud server.
const contentMD5 = request.headers['content-md5'];
if (contentMD5 && contentMD5 !== md5) {
return callback(errors.BadDigest); return callback(errors.BadDigest);
} }
const { key, dataStoreName } = retrievalInfo; const { key, dataStoreName } = retrievalInfo;