From d2b560518254860b233faac536c36ca8a638969f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 7 Dec 2022 15:14:33 +0100 Subject: [PATCH] fix: Force UA so we dont try to re-cache in a loop. --- lookyloo/capturecache.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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: