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

Collect the user IP from X-Forwarded-For, then falls back to X-Real-Ip #370

Merged
merged 2 commits into from
Apr 6, 2021

Conversation

bxsx
Copy link
Contributor

@bxsx bxsx commented Apr 1, 2021

Description of the change

The user IP will be taken from the X-Forwarded-For before checking X-Real-Ip to receive more accurate information if available.
Also, the current state of the sequence for checking the IP is not consistent across all supported frameworks.

This PR solves both issues.

I'm marking it as a breaking change as the final user IP in a payload may be different in some cases. However, this change shouldn't affect user code, and in most cases shouldn't be even noticeable.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@bxsx bxsx self-assigned this Apr 1, 2021
@waltjones waltjones self-requested a review April 1, 2021 20:21
Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

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

👍

@bxsx
Copy link
Contributor Author

bxsx commented Apr 6, 2021

There were 2 issues with building the PR.

  • Unnecessary launching the build at CircleCI (that is not configured and not used)
  • Temporary problem with GitHub CI downloading six package. Relaunching jobs has helped.

Ready to merge now.

@bxsx bxsx merged commit 5196cc5 into master Apr 6, 2021
@bxsx bxsx deleted the bxsx/extract-user-ip branch April 6, 2021 11:44
@bxsx bxsx added this to the v0.16.0 milestone Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants