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

Adding Cloudflare IP detection compatibility #110

Merged
merged 1 commit into from
Feb 28, 2020
Merged

Conversation

eightam
Copy link
Contributor

@eightam eightam commented Jan 23, 2020

Description of the Change

Adding proprietary Cloudflare headers to IP detection.

Alternate Designs

Cloudflare only stores the real client IP in these headers, no other solution found.

Benefits

Plugin will work with sites served through Cloudflare.

Possible Drawbacks

None noticed.

Verification Process

Clicking the "Add my own IP Address" button produced the real client IP.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#109

@jeffpaul jeffpaul added this to the 7.3.0 milestone Jan 24, 2020
@jeffpaul jeffpaul added the type:bug Something isn’t working. label Jan 24, 2020
@jeffpaul
Copy link
Member

@eightam thanks for the PR! I’ve set this for our next release and will get back to you if there are any questions or concerns after review.

Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't reproduce in my test, the value of HTTP_X_FORWARDED_FOR is the client IP address, but this PR and the associated issue are valid.

See https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn’t working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_client_ip_address detects Server IP if on Cloudflare
3 participants