mirror of https://github.com/CIRCL/lookyloo
fix: Do not fail on MISP export if there are no redirects
parent
3b8b3faff4
commit
7241ae2ea1
|
@ -924,11 +924,12 @@ class Lookyloo():
|
||||||
initial_url = URLObject(cache["url"]) # type: ignore
|
initial_url = URLObject(cache["url"]) # type: ignore
|
||||||
redirects = [URLObject(url) for url in cache['redirects']] # type: ignore
|
redirects = [URLObject(url) for url in cache['redirects']] # type: ignore
|
||||||
|
|
||||||
initial_url.add_reference(redirects[0], 'redirects-to')
|
if redirects:
|
||||||
prec_object = redirects[0]
|
initial_url.add_reference(redirects[0], 'redirects-to')
|
||||||
for u_object in redirects[1:]:
|
prec_object = redirects[0]
|
||||||
prec_object.add_reference(u_object, 'redirects-to')
|
for u_object in redirects[1:]:
|
||||||
prec_object = u_object
|
prec_object.add_reference(u_object, 'redirects-to')
|
||||||
|
prec_object = u_object
|
||||||
|
|
||||||
event.add_object(initial_url)
|
event.add_object(initial_url)
|
||||||
for u_object in redirects:
|
for u_object in redirects:
|
||||||
|
|
Loading…
Reference in New Issue