diff --git a/bin/async_capture.py b/bin/async_capture.py index edc290e6..ebf6aa5b 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -64,10 +64,10 @@ class AsyncCapture(AbstractManager): if get_config('generic', 'default_public'): # By default, the captures are on the index, unless the user mark them as un-listed - listing = False if ('listing' in to_capture and to_capture[b'listing'].lower() in [b'false', b'0', b'']) else True + listing = False if (b'listing' in to_capture and to_capture[b'listing'].lower() in [b'false', b'0', b'']) else True else: # By default, the captures are not on the index, unless the user mark them as listed - listing = True if ('listing' in to_capture and to_capture[b'listing'].lower() in [b'true', b'1']) else False + listing = True if (b'listing' in to_capture and to_capture[b'listing'].lower() in [b'true', b'1']) else False # Turn the freetext for the headers into a dict headers: Dict[str, str] = {} diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index bb5bcf4e..67c48e40 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -399,11 +399,12 @@ class Lookyloo(): if isinstance(value, bool): query[key] = 1 if value else 0 elif isinstance(value, (list, dict)): - query[key] = json.dumps(value) + query[key] = json.dumps(value) if value else None if 'document_name' in query: query['document_name'] = secure_filename(query['document_name']) + query = {k: v for k, v in query.items() if v is not None} # Remove the none, it makes redis unhappy # dirty deduplicate hash_query = hashlib.sha512(pickle.dumps(query)).hexdigest() # FIXME The line below should work, but it doesn't