rename var
This commit is contained in:
parent
f815821cd6
commit
1568833853
1 changed files with 6 additions and 6 deletions
12
ipserv.py
12
ipserv.py
|
@ -59,12 +59,12 @@ async def ip(
|
|||
logging.info("cache expired for %s", ip)
|
||||
|
||||
logging.info("looking up IP info for %s", ip)
|
||||
result = await make_request(
|
||||
data = await make_request(
|
||||
ip,
|
||||
{"User-Agent": User_Agent}
|
||||
)
|
||||
if isinstance(result, HTTPException):
|
||||
return result
|
||||
if isinstance(data, HTTPException):
|
||||
return data
|
||||
data["ip"] = ip
|
||||
data.pop("legalese", None)
|
||||
data.pop("source", None)
|
||||
|
@ -84,12 +84,12 @@ async def lookup(ip: str = Query(...), User_Agent: str = Header("Mozilla/5.0")):
|
|||
logging.info("cache expired for %s", ip)
|
||||
|
||||
logging.info("looking up IP info for %s", ip)
|
||||
result = await make_request(
|
||||
data = await make_request(
|
||||
ip,
|
||||
{"User-Agent": User_Agent}
|
||||
)
|
||||
if isinstance(result, HTTPException):
|
||||
return result
|
||||
if isinstance(data, HTTPException):
|
||||
return data
|
||||
data["ip"] = ip
|
||||
data.pop("legalese", None)
|
||||
data.pop("source", None)
|
||||
|
|
Reference in a new issue