Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With xheaders request.remote_ip should return first ip in X-Forwarded-For chain #1301

Closed
wants to merge 1 commit into from

Conversation

mclate
Copy link

@mclate mclate commented Jan 10, 2015

When request is proxied through several proxies, X-Forwarded-For header will have values in format origin,proxy1,proxy2,...
This PR will allow client to get first value in forwarded chain, thus getting ip of the origin request.

@bdarnell
Copy link
Member

The first and last X-Forwarded-For values are both useful, but for different purposes. The last value is most analogous to the actual socket address used for remote_ip, so we should continue using it here. See #904 and #1051 for discussion about adding a method to return the first value.

@bdarnell bdarnell closed this Jan 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants