From 45ac09aa04a8e0b42e9d6b0eb262c4e5e72a3859 Mon Sep 17 00:00:00 2001 From: Fabien Millerand Date: Mon, 21 Aug 2017 22:22:22 +0200 Subject: [PATCH] Get the right client address --- daphne/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daphne/utils.py b/daphne/utils.py index cb8043c..dd5eb6b 100644 --- a/daphne/utils.py +++ b/daphne/utils.py @@ -37,7 +37,7 @@ def parse_x_forwarded_for(headers, address_value = header_value(headers, address_header_name) if ',' in address_value: - address_value = address_value.split(",")[0].strip() + address_value = address_value.split(",")[-1].strip() result = [address_value, 0]