I got a weird bug, in which request.client_addr was reported as 
192.168.76.75:52411, which broke a function which expected it to be a 
standard IP address. In the documentation I've read that this could be 
anything, so I guess this isn't a surprise.

I am using CloudFlare -> nginx -> gunicorn -> pyramid setup. These were the 
headers of that request:

X-Forwarded-For 192.168.76.75:52411,67.133.63.210, 108.162.246.204
Cf-Connecting-Ip 67.133.63.210

My question is that since I'm using CloudFlare and I know that 
Cf-Connecting-Ip is a reliable, trustable source of IP address, unlike 
X-Forwarded-For. How should I modify my request.client_addr to use this 
value whenever it is present?

Zsolt

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/e643ca5d-763e-45bd-b077-d09b448b2fb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to