From db639d9dde9b46e338427513f9a607078a3248e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 27 Jul 2023 12:43:52 +0200 Subject: [PATCH] chg: Improve logging for errors in cookies, bump har2tree --- lookyloo/helpers.py | 8 ++++---- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lookyloo/helpers.py b/lookyloo/helpers.py index 6fd89644..1c68ed42 100644 --- a/lookyloo/helpers.py +++ b/lookyloo/helpers.py @@ -158,15 +158,15 @@ def load_cookies(cookie_pseudofile: Optional[Union[BufferedIOBase, str, bytes, L if isinstance(cookie_pseudofile, (str, bytes)): try: cookies = json.loads(cookie_pseudofile) - except json.decoder.JSONDecodeError: - logger.warning(f'Unable to load json content: {cookie_pseudofile!r}') + except json.decoder.JSONDecodeError as e: + logger.warning(f'Unable to load json content ({e}): {cookie_pseudofile!r}') return [] elif isinstance(cookie_pseudofile, BufferedIOBase): # Note: we might have an empty BytesIO, which is not False. try: cookies = json.load(cookie_pseudofile) - except json.decoder.JSONDecodeError: - logger.warning(f'Unable to load json content: {cookie_pseudofile}') + except json.decoder.JSONDecodeError as e: + logger.warning(f'Unable to load json content ({e}): {cookie_pseudofile.read()!r}') return [] else: # Already a dict diff --git a/poetry.lock b/poetry.lock index 203ba012..b633cc0f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -908,13 +908,13 @@ tornado = ["tornado (>=0.2)"] [[package]] name = "har2tree" -version = "1.21.3" +version = "1.21.4" description = "HTTP Archive (HAR) to ETE Toolkit generator" optional = false python-versions = ">=3.8,<3.12" files = [ - {file = "har2tree-1.21.3-py3-none-any.whl", hash = "sha256:663d78ea2409fcc1b8f0b387154ecefb11d69aa3b6bd7cd71b9efc0754a718b6"}, - {file = "har2tree-1.21.3.tar.gz", hash = "sha256:6e7b03b639b33700c85d470a23cb864071be362d4dda132a78475bd05de23aae"}, + {file = "har2tree-1.21.4-py3-none-any.whl", hash = "sha256:3f26b06b8e52f811cef35bac02a3266c8ce1354e4674353f884ecb2c01ec56a9"}, + {file = "har2tree-1.21.4.tar.gz", hash = "sha256:c2941315f24a7c207bf79acd1c2da52b57dce31c4685d34cb63b5ce2fbabdcda"}, ] [package.dependencies] @@ -3146,4 +3146,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12" -content-hash = "141ce8afa6057e50da08f5960b8abdca79ff3a509dc937bdbf8f0ea89cc1f76e" +content-hash = "005fd2ad7533d8f017f529ffd2b8844a7c41b40d7f63e8ce599a42595c59375f" diff --git a/pyproject.toml b/pyproject.toml index 5187b08c..ffa7cda5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ pyhashlookup = "^1.2.1" lief = "^0.13.2" ua-parser = "^0.18.0" Flask-Login = "^0.6.2" -har2tree = "^1.21.3" +har2tree = "^1.21.4" passivetotal = "^2.5.9" werkzeug = "^2.3.6" filetype = "^1.2.0"