fix: Strip all non-URL characters from capture.

pull/777/head
Raphaël Vinot 2023-09-11 16:51:58 +02:00
parent 9e3b7d2136
commit 0365c9d6c9
1 changed files with 5 additions and 0 deletions

View File

@ -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: