Skip to content
Snippets Groups Projects
Commit 94f4f748 authored by Piero Toffanin's avatar Piero Toffanin
Browse files

Better X-Forwarded-For logic

parent eb8b389e
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ def get_json_dict(request):
def get_remote_address():
if request.headers.getlist("X-Forwarded-For"):
ip = request.headers.getlist("X-Forwarded-For")[0]
ip = request.headers.getlist("X-Forwarded-For")[0].split(",")[0]
else:
ip = request.remote_addr or "127.0.0.1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment