ashcrow/flask-track-usage — pull request #16 by jamylak (2014-12-25 20:58:46+00:00)
Title: Include X-Forwarded-For as well as remote_addr

"Since it is easy to forge an X-Forwarded-For field the given information should be used with care. The last IP address is always the IP address that connects to the last proxy, which means it is the most reliable source of information. X-Forwarded-For data can be used in a forward or reverse proxy scenario.

Just logging the X-Forwarded-For field is not always enough as the last proxy IP address in a chain is not contained within the X-Forwarded-For field, it is in the actual IP header. A web server should log BOTH the request's source IP address and the X-Forwarded-For field information for completeness."

Why not log both instead of guessing? Would love to hear feedback on this.