Fixed IP Proxy

This commit is contained in:
Adolfo Gómez García 2020-05-11 15:09:52 +02:00
parent f1e8011f42
commit 66e3dc11ea

View File

@ -144,7 +144,7 @@ class GlobalRequestMiddleware:
if not request.ip or behind_proxy is True: # Request.IP will be None in case of nginx & gunicorn
request.ip = request.ip_proxy # Stores the ip
# will raise "list out of range", leaving ip_proxy = proxy in case of no other proxy apart of nginx
request.ip_proxy = proxies[1]
request.ip_proxy = proxies[1].strip()
except Exception:
request.ip_proxy = request.ip