-
Notifications
You must be signed in to change notification settings - Fork 800
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
Plans in Plugin: correctly forward the client IP for currency localization #8930
Conversation
Follows on from #8834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep X_FORWARDED_FOR and CLIENT_IP headers because a lot of hosts probably have load balancers in front of their servers. Especially places like GC, AWS, etc.
// no ip list to forward, so create one: | ||
$ip = $_SERVER['HTTP_CLIENT_IP']; | ||
} | ||
// passing along from client to help geolocate currency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to start with X_FORWARDED_FOR
in case there's a load balancer in front of the site (like cloudflare, AWS)
$ip = $_SERVER['HTTP_CLIENT_IP']; | ||
} | ||
// passing along from client to help geolocate currency | ||
$ip = $_SERVER['REMOTE_ADDR']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP_CLIENT_IP is another proxy var that might be set ... I completely forget about REMOTE_ADDR (it's not applicable to my test site, so overlooked it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rely on the data we get and store for Protect in here? It may provide us with at reliable IP address?
See the trusted_ip_header
option for example.
haha, I was just working on the same thing, thanks |
* update changelog.txt * Update readme.txt with scaffolding for 5.9 changelog and release draft shortlink * Add changelog entry for #8243 * Add changelog entry for #8296 * Add changelog entry for #8367 * Add changelog entry for #8686 * Add changelog entry for #8707 * Add changelog entry for #8709 and #8714 * Add changelog entry for #8729 * Add changelog entry for #8777 * Add changelog entry for #8780 * Add changelog entry for #8786 * Add changelog entry for #8787 * Add changelog entry for #8801 #8805 #8832 #8865 and #8804 * Add changelog entry for #8817 * Add changelog entry for #8822 * Add changelog entry for #8823 * Add changelog entry for #8829 * Add changelog entry for #8834 * move some items to major enhancements * Add changelog entry for #8836 * Add changelog entry for #8839 * Add changelog entry for #8861 * Add changelog entry for #8862 * Add changelog entry for #8863 * Add changelog entry for #8866 * Add changelog entry for #8870 * Add changelog entry for #8874 * Add changelog entry for #8875 * Add changelog entry for #8881 * Add changelog entry for #8890 * Add changelog entry for #8911 * Add changelog entry for #8927 * Add changelog entry for #8931 * Add changelog entry for #8933 * Add changelog entry for #8930 * fix wording * typo * minor fixes * replace partner scripts for Jetpack Start in changelog entry * Update to-test.md * Update to-test.md * minor style fixes to to-test.md * minor style fixes to to-test.md * minor fixes on to-test.md * Add changelog entry for #8868 * Add changelog entry for #8844 * Add changelog entry for #8664 * Add changelog entry for #8935 * Add changelog entry for #8425 * Add changelog entry for #8625
Follows on from #8834
Changes proposed in this Pull Request:
$_SERVER
var from the client so that the wpcom plans endpoint can guess the client's locale and localize the currenctyjetpack_cache_plans
filter returns falseChangelog entry
Plans: correctly forward the client IP for currency localization.