fix some things :3

This commit is contained in:
Felix Pankratz 2023-06-08 16:14:47 +02:00
parent cd763f3930
commit 7f6b5dda21

6
ip.py Normal file → Executable file
View 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)