From 35cb77c398dbeeb63662957af27240349ca5f2bb Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 3 Dec 2019 12:13:28 +0100 Subject: [PATCH] Fix double ip in generated score --- contextualise.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contextualise.py b/contextualise.py index e00cfd8..4c81eec 100644 --- a/contextualise.py +++ b/contextualise.py @@ -217,6 +217,10 @@ def get_file(): else: userip = request.environ['HTTP_X_FORWARDED_FOR'] # if behind a proxy + # Proxy might add multiple ips, take only one: + if ',' in userip: + userip = userip.split(',')[0] + # CALCULATION OF INITIAL TIME BEFORE FIRST CLICK if len(timelist) and not (timelist[0] is None): thetime = timelist[0]