From 0365c9d6c905bb145c5d5a7c299074fee928be10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 11 Sep 2023 16:51:58 +0200 Subject: [PATCH] fix: Strip all non-URL characters from capture. --- lookyloo/lookyloo.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 81fb843a..5132fb19 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -587,6 +587,11 @@ class Lookyloo(): def _prepare_lacus_query(self, query: CaptureSettings) -> CaptureSettings: # Remove the none, it makes redis unhappy query = {k: v for k, v in query.items() if v is not None} # type: ignore + + if 'url' in query and query['url'] is not None: + # Make sure the URL does not have any space or newline + query['url'] = query['url'].strip() + # NOTE: Lookyloo' capture can pass a do not track header independently from the default headers, merging it here headers = query.pop('headers', {}) if 'dnt' in query: