fix some things :3
This commit is contained in:
parent
cd763f3930
commit
7f6b5dda21
6
ip.py
Normal file → Executable file
6
ip.py
Normal file → Executable file
@ -16,13 +16,13 @@ def main():
|
||||
"location": None
|
||||
}
|
||||
header()
|
||||
client_ip = cgi.escape(os.environ["REMOTE_ADDR"])
|
||||
format = F_PLAIN
|
||||
client_ip = os.environ["REMOTE_ADDR"]
|
||||
if(len(params) > 0):
|
||||
for key in params:
|
||||
if key == "geo":
|
||||
gi = pygeoip.GeoIP('GeoLiteCity.dat')
|
||||
geo_info = gi.record_by_addr(ip)
|
||||
geo_info = gi.record_by_addr(client_ip)
|
||||
geo_info['ip'] = client_ip
|
||||
print(geo_info)
|
||||
else:
|
||||
print(client_ip)
|
||||
|
Loading…
Reference in New Issue
Block a user