diff --git a/lookyloo/capturecache.py b/lookyloo/capturecache.py index 25a49ec5..0544bebe 100644 --- a/lookyloo/capturecache.py +++ b/lookyloo/capturecache.py @@ -311,11 +311,9 @@ class CapturesIndex(Mapping): cache['url'] = har.root_url cache['redirects'] = json.dumps(tree.redirects) cache['incomplete_redirects'] = 0 + cache['user_agent'] = har.root_user_agent if har.root_user_agent else 'No User Agent.' if har.root_referrer: cache['referer'] = har.root_referrer - if har.root_user_agent: - # NOTE: This should always be the case (?) - cache['user_agent'] = har.root_user_agent except Har2TreeError as e: cache['error'] = str(e) else: