Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Do not override REMOTE_ADDR with X-Fowarded-For #633
From rfc 3875
def application(environ, start_response):
Running server and client:
Before that patch, using gunicorn, it is impossible to get the proxy address inside the WSGi application.
You can actually disable this behaviour by setting the
Anyway the old Web CGI interface spec  is more explicit than the final spec:
where the final spec  says:
It is not clear in the final spec if the client is the proxy or not. Anyway if other wsgi server are doing the first one, we should fix it in gunicorn.
I'm reluctant to remove all that useful code though :) so maybe we could add another environ I dunno.
Feedback is welcome.
When using a Unix socket:
I'm finally in favour of introducing the following breaking change like the initial patch suggested:
To facilitate the transition we could propose some code to get the forwarded IP in the doc.