Plans in Plugin: correctly forward the client IP for currency localization#8930
Plans in Plugin: correctly forward the client IP for currency localization#8930
Conversation
Follows on from #8834
withinboredom
left a comment
There was a problem hiding this comment.
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.
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.
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)
jeherve
left a comment
There was a problem hiding this comment.
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:
$_SERVERvar from the client so that the wpcom plans endpoint can guess the client's locale and localize the currenctyjetpack_cache_plansfilter returns falseChangelog entry
Plans: correctly forward the client IP for currency localization.