From 226ae5784be3e08381c0e48d90143c9fe6717ddc Mon Sep 17 00:00:00 2001 From: venusbb Date: Mon, 10 Jul 2017 17:33:13 +0100 Subject: [PATCH] reading ip address 3rd from the back rather than the first one --- app/authentication/auth.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/authentication/auth.py b/app/authentication/auth.py index 31f2764d9..40eccc3b8 100644 --- a/app/authentication/auth.py +++ b/app/authentication/auth.py @@ -48,7 +48,6 @@ def restrict_ip_sms(): if request.headers.get("X-Forwarded-For"): # X-Forwarded-For looks like "203.0.113.195, 70.41.3.18, 150.172.238.178" ip_route = request.headers.get("X-Forwarded-For") - # ip = ip_list.split(',')[0].strip() ip_list = ip_route.split(',') if len(ip_list) >= 3: ip = ip_list[len(ip_list) - 3]