Get first X-Forwarded-For IP

This commit is contained in:
fermayo 2014-06-24 18:01:12 +02:00
parent 778f208cc1
commit 5b94c44434

View file

@ -66,6 +66,7 @@ def get_ip(request):
else:
logging.debug('Axes is configured to be behind reverse proxy...looking for header value %s', REVERSE_PROXY_HEADER)
ip = request.META.get(REVERSE_PROXY_HEADER, '')
ip = ip.split(",", 1)[0].strip()
if ip == '':
raise Warning('Axes is configured for operation behind a reverse proxy but could not find '\
'an HTTP header value {0}. Check your proxy server settings '\