From 8b1a2658bbbb80e7eb1ccb9c17106cb1aa649505 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Tue, 9 Jun 2020 08:25:11 +0200 Subject: [PATCH] cache signature location handling fixed (#460, #466) --- lib/cache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cache.py b/lib/cache.py index 3317cb7..fe257eb 100644 --- a/lib/cache.py +++ b/lib/cache.py @@ -41,6 +41,10 @@ def get_signature(user_agent, query_string, client_ip_address, lang): location = query_string.split("?", 1)[0] else: location = query_string + if location.startswith("http://"): + location = location[7:] + elif location.startswith("https://"): + location = location[8:] if ":" in location: return None @@ -81,7 +85,7 @@ def store(signature, value): Store in cache `value` for `signature` """ if not signature: - return value + return _update_answer(value) if len(value) >= MIN_SIZE_FOR_FILECACHE: value_to_store = _store_in_file(signature, value)