mirror of
https://github.com/jazzband/django-axes.git
synced 2026-05-09 16:14:46 +00:00
Merge pull request #80 from tutumcloud/split-forwarded-for
Get first X-Forwarded-For IP
This commit is contained in:
commit
a6a3e476ac
1 changed files with 1 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ def get_ip(request):
|
|||
ip = request.META.get('REMOTE_ADDR', '')
|
||||
else:
|
||||
ip = request.META.get(REVERSE_PROXY_HEADER, '')
|
||||
ip = ip.split(",", 1)[0].strip()
|
||||
if ip == '':
|
||||
if not BEHIND_REVERSE_PROXY_WITH_DIRECT_ACCESS:
|
||||
raise Warning('Axes is configured for operation behind a reverse proxy but could not find '\
|
||||
|
|
|
|||
Loading…
Reference in a new issue