cache signature location handling fixed (#460, #466)

pull/468/head
Igor Chubin 5 years ago
parent ef7d46723d
commit 8b1a2658bb

@ -41,6 +41,10 @@ def get_signature(user_agent, query_string, client_ip_address, lang):
location = query_string.split("?", 1)[0] location = query_string.split("?", 1)[0]
else: else:
location = query_string location = query_string
if location.startswith("http://"):
location = location[7:]
elif location.startswith("https://"):
location = location[8:]
if ":" in location: if ":" in location:
return None return None
@ -81,7 +85,7 @@ def store(signature, value):
Store in cache `value` for `signature` Store in cache `value` for `signature`
""" """
if not signature: if not signature:
return value return _update_answer(value)
if len(value) >= MIN_SIZE_FOR_FILECACHE: if len(value) >= MIN_SIZE_FOR_FILECACHE:
value_to_store = _store_in_file(signature, value) value_to_store = _store_in_file(signature, value)

Loading…
Cancel
Save