From 35adef8336954bb5631a4e71c377000af9f14faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 15 Mar 2019 18:00:28 +0100 Subject: [PATCH] fix: Make sure to pass an IP to ipasn.query --- website/web/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/web/__init__.py b/website/web/__init__.py index 97e89a1..13c0f8b 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -166,12 +166,18 @@ def ipasn(): d = request.form elif request.method == 'GET': d = request.args + if not d or 'ip' not in d: return render_template('ipasn.html') + else: + if isinstance(d['ip'], list): + ip = d['ip'][0] + else: + ip = d['ip'] ipasn = get_ipasn() q = Querying() response = ipasn.query(first=(date.today() - timedelta(days=60)).isoformat(), - aggregate=True, **d) + aggregate=True, ip=ip) for r in response['response']: r['asn_description'] = [] asn_descriptions = q.get_asn_descriptions(asn=r['asn'], all_descriptions=True)