From 0c8e5394a1b89404b521598e4e9835980cc04ee1 Mon Sep 17 00:00:00 2001 From: venusbb Date: Tue, 4 Jul 2017 16:06:30 +0100 Subject: [PATCH] modified the parsing of return ip address --- app/authentication/auth.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/authentication/auth.py b/app/authentication/auth.py index 6bc9d0490..7227ead3b 100644 --- a/app/authentication/auth.py +++ b/app/authentication/auth.py @@ -47,7 +47,9 @@ def requires_no_auth(): def restrict_ip_sms(): ip = '' if request.headers.getlist("X-Forwarded-For"): - ip = request.headers.getlist("X-Forwarded-For")[0] + ip0 = request.headers.getlist("X-Forwarded-For") + ip1 = ip0.split(','); + ip = ip1[0] if ip in current_app.config.get('ALLOW_IP_INBOUND_SMS'): current_app.logger.info("Inbound sms ip addresses {} passed ".format(ip))