mirror of https://github.com/CIRCL/lookyloo
fix: logic issue in last commit
parent
79c9b95faf
commit
3193763c8a
|
@ -729,12 +729,17 @@ class Lookyloo():
|
||||||
smtp_auth = get_config('generic', 'email_smtp_auth')
|
smtp_auth = get_config('generic', 'email_smtp_auth')
|
||||||
redirects = ''
|
redirects = ''
|
||||||
initial_url = ''
|
initial_url = ''
|
||||||
cache = self.capture_cache(capture_uuid)
|
if cache := self.capture_cache(capture_uuid):
|
||||||
if cache and hasattr(cache, 'url'):
|
if hasattr(cache, 'url'):
|
||||||
if email_config['defang_urls']:
|
if email_config['defang_urls']:
|
||||||
initial_url = defang(cache.url, colon=True, all_dots=True)
|
initial_url = defang(cache.url, colon=True, all_dots=True)
|
||||||
|
else:
|
||||||
|
initial_url = cache.url
|
||||||
else:
|
else:
|
||||||
initial_url = cache.url
|
initial_url = 'Unable to get URL from cache, this is probably a bug.'
|
||||||
|
if hasattr(cache, 'error') and cache.error:
|
||||||
|
initial_url += f' - {cache.error}'
|
||||||
|
|
||||||
if hasattr(cache, 'redirects') and cache.redirects:
|
if hasattr(cache, 'redirects') and cache.redirects:
|
||||||
redirects = "Redirects:\n"
|
redirects = "Redirects:\n"
|
||||||
if email_config['defang_urls']:
|
if email_config['defang_urls']:
|
||||||
|
@ -743,10 +748,6 @@ class Lookyloo():
|
||||||
redirects += '\n'.join(cache.redirects)
|
redirects += '\n'.join(cache.redirects)
|
||||||
else:
|
else:
|
||||||
redirects = "No redirects."
|
redirects = "No redirects."
|
||||||
else:
|
|
||||||
initial_url = 'Unable to get URL from cache, this is probably a bug.'
|
|
||||||
if hasattr(cache, 'error'):
|
|
||||||
initial_url += f' - {cache.error}'
|
|
||||||
|
|
||||||
msg = EmailMessage()
|
msg = EmailMessage()
|
||||||
msg['From'] = email_config['from']
|
msg['From'] = email_config['from']
|
||||||
|
|
Loading…
Reference in New Issue