From: Michael Tremer Date: Sun, 15 Jul 2012 13:38:16 +0000 (+0200) Subject: Fix handling hosts behind a proxy server. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1493cb3cf5433729235e3788ed6f63b63f66253;p=ipfire.org.git Fix handling hosts behind a proxy server. --- diff --git a/fireinfo/fireinfod b/fireinfo/fireinfod index 51056682..f51173c7 100755 --- a/fireinfo/fireinfod +++ b/fireinfo/fireinfod @@ -302,10 +302,14 @@ class ProfileSendHandler(BaseHandler): self.check_profile() # Get GeoIP information if address is not defined in rfc1918 - addr = ipaddr.IPAddress(self.request.remote_ip) - if not addr.is_private: - remote_ips = self.request.remote_ip.split(", ") - profile.geoip = self.geoip.get_all(remote_ips[-1]) + remote_ips = self.request.remote_ip.split(", ") + for remote_ip in remote_ips: + addr = ipaddr.IPAddress(remote_ip) + if addr.is_private: + continue + + profile.geoip = self.geoip.get_all(remote_ip) + break # Move previous profiles to archive and keep only the latest one # in profiles. This will make full table lookups faster.