mirror of https://github.com/MISP/misp-modules
fix: #137 when a CVE is not found, a return message is given
parent
2f6406b1e5
commit
03baa0b84d
|
@ -19,8 +19,11 @@ def handler(q=False):
|
|||
r = requests.get(cveapi_url + request.get('vulnerability'))
|
||||
if r.status_code == 200:
|
||||
vulnerability = json.loads(r.text)
|
||||
if vulnerability.get('summary'):
|
||||
summary = vulnerability['summary']
|
||||
if vulnerability:
|
||||
if vulnerability.get('summary'):
|
||||
summary = vulnerability['summary']
|
||||
else:
|
||||
summary = 'Non existing CVE'
|
||||
else:
|
||||
misperrors['error'] = 'cve.circl.lu API not accessible'
|
||||
return misperrors['error']
|
||||
|
|
Loading…
Reference in New Issue