mirror of https://github.com/MISP/misp-modules
CountryCode JSON now is only grabbed once per server run
parent
317f820bbf
commit
4ba86d4fa3
|
@ -20,7 +20,10 @@ common_tlds = {"com":"Commercial (Worldwide)",
|
||||||
"gov":"Government (USA)"
|
"gov":"Government (USA)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
codes = requests.get("http://www.geognos.com/api/en/countries/info/all.json").json()
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
|
global codes
|
||||||
if q is False:
|
if q is False:
|
||||||
return False
|
return False
|
||||||
request = json.loads(q)
|
request = json.loads(q)
|
||||||
|
@ -34,8 +37,6 @@ def handler(q=False):
|
||||||
val = common_tlds[ext]
|
val = common_tlds[ext]
|
||||||
else:
|
else:
|
||||||
# Retrieve a json full of country info
|
# Retrieve a json full of country info
|
||||||
codes = requests.get("http://www.geognos.com/api/en/countries/info/all.json").json()
|
|
||||||
|
|
||||||
if not codes["StatusMsg"] == "OK":
|
if not codes["StatusMsg"] == "OK":
|
||||||
val = "Unknown"
|
val = "Unknown"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue