From 0b0f57b30c349aabe5f43749f33c33829d78b3cd Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Wed, 6 Jun 2018 08:31:41 +0200 Subject: [PATCH] Update countrycode.py --- misp_modules/modules/expansion/countrycode.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misp_modules/modules/expansion/countrycode.py b/misp_modules/modules/expansion/countrycode.py index af58fc6..9f22c40 100755 --- a/misp_modules/modules/expansion/countrycode.py +++ b/misp_modules/modules/expansion/countrycode.py @@ -20,10 +20,12 @@ common_tlds = {"com":"Commercial (Worldwide)", "gov":"Government (USA)" } -codes = requests.get("http://www.geognos.com/api/en/countries/info/all.json").json() +codes = False def handler(q=False): global codes + if not codes: + codes = requests.get("http://www.geognos.com/api/en/countries/info/all.json").json() if q is False: return False request = json.loads(q)