MCPcopy
hub / github.com/scality/cloudserver / checkHashMatchMD5

Function checkHashMatchMD5

lib/services.js:85–92  ·  view source on GitHub ↗

* Check that hashedStream.completedHash matches header contentMd5. * @param {object} contentMD5 - content-md5 header * @param {string} completedHash - hashed stream once completed * @param {RequestLogger} log - the current request logger * @return {boolean} - true if contentMD5 match

(contentMD5, completedHash, log)

Source from the content-addressed store, hash-verified

83 * false otherwise
84 */
85 checkHashMatchMD5(contentMD5, completedHash, log) {
86 if (contentMD5 && completedHash && contentMD5 !== completedHash) {
87 log.debug('contentMD5 and completedHash does not match',
88 { method: 'checkHashMatchMD5', completedHash, contentMD5 });
89 return false;
90 }
91 return true;
92 },
93
94 /**
95 * Stores object location, custom headers, version etc.

Callers

nothing calls this directly

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected