From 74c0e8c8c2038b1f92eec1787f28463425fabbbd Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Wed, 1 Sep 2021 19:56:50 +0200 Subject: [PATCH] fix: [api/md5] if there is already more data in default SHA1 we use that one and not the fall-back MD5 lookup --- bin/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/server.py b/bin/server.py index 548828c..90d5f43 100644 --- a/bin/server.py +++ b/bin/server.py @@ -100,7 +100,7 @@ class lookup(Resource): session_key = "session:{}:exist".format(request.headers.get('hashlookup_session')) rdb.sadd(session_key, k) rdb.expire(session_key, ttl) - if rdb.exists("h:{}".format(k)): + if rdb.exists("h:{}".format(k)) and not rdb.exists("l:{}".format(k)): h = rdb.hgetall("h:{}".format(k)) sha1 = k else: