Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We also use the contact form to report various errors on the website. To facilitate communication and better understand the problem, we collect some basic information about user's client (browser). Migrating to Fly introduced a bit of confusion with the IP address. In most hostings we can get it using: ```ruby request.remote_ip request.remote_addr ``` or ```ruby request.env['HTTP_X_REAL_IP'] request.env['REMOTE_ADDR'] ``` However, research showed me that Fly has a custom field in the header. For posterity, I have kept the most important links: [1] [2] [3] [4] So the "Fly-Client-IP" field can be found in Rails under `request.env['HTTP_FLY_CLIENT_IP']`, which doesn't seem intuitive to me. [1]: https://fly.io/docs/reference/runtime-environment/#request-headers [2]: https://community.fly.io/t/how-to-retreive-the-real-ip-address-of-an-http-request-with-v2-app-with-http-service-configuration/12095 [3]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For [4]: https://stackoverflow.com/questions/10997005/whats-the-difference-between-request-remote-ip-and-request-ip-in-rails
- Loading branch information