mirror of https://github.com/CIRCL/lookyloo
fix: Avoid invalid URL chars in filename
parent
49f335405e
commit
64c550919d
|
@ -24,6 +24,7 @@ from PIL import Image, UnidentifiedImageError
|
||||||
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
from pymisp import MISPAttribute, MISPEvent, MISPObject
|
||||||
from redis import ConnectionPool, Redis
|
from redis import ConnectionPool, Redis
|
||||||
from redis.connection import UnixDomainSocketConnection
|
from redis.connection import UnixDomainSocketConnection
|
||||||
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
from .capturecache import CaptureCache, CapturesIndex
|
from .capturecache import CaptureCache, CapturesIndex
|
||||||
from .context import Context
|
from .context import Context
|
||||||
|
@ -400,6 +401,9 @@ class Lookyloo():
|
||||||
elif isinstance(value, (list, dict)):
|
elif isinstance(value, (list, dict)):
|
||||||
query[key] = json.dumps(value)
|
query[key] = json.dumps(value)
|
||||||
|
|
||||||
|
if 'document_name' in query:
|
||||||
|
query['document_name'] = secure_filename(query['document_name'])
|
||||||
|
|
||||||
# dirty deduplicate
|
# dirty deduplicate
|
||||||
hash_query = hashlib.sha512(pickle.dumps(query)).hexdigest()
|
hash_query = hashlib.sha512(pickle.dumps(query)).hexdigest()
|
||||||
# FIXME The line below should work, but it doesn't
|
# FIXME The line below should work, but it doesn't
|
||||||
|
|
Loading…
Reference in New Issue