mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 05:42:55 +00:00
check sha1 hash value only if present
This commit is contained in:
parent
bd70aaa76c
commit
b5a4458b68
1 changed files with 3 additions and 1 deletions
|
@ -67,7 +67,9 @@ module.exports = RedisManager =
|
|||
multi.exec (error, [docLines, version, storedHash, doc_project_id, ranges])->
|
||||
timer.done()
|
||||
return callback(error) if error?
|
||||
if docLines?
|
||||
|
||||
# check sha1 hash value if present
|
||||
if docLines? and storedHash?
|
||||
computedHash = RedisManager._computeHash(docLines)
|
||||
if computedHash isnt storedHash
|
||||
logger.error project_id: project_id, doc_id: doc_id, doc_project_id: doc_project_id, computedHash: computedHash, storedHash: storedHash, "hash mismatch on retrieved document"
|
||||
|
|
Loading…
Reference in a new issue