diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 58aad4ea..0ca1be1d 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -607,7 +607,7 @@ class Lookyloo(): return None if not h or h == url.body_hash: # we want the body - return url.filename if url.filename else 'file.bin', url.body, url.mimetype + return url.filename if url.filename else 'file.bin', BytesIO(url.body.getvalue()), url.mimetype # We want an embedded ressource if h not in url.resources_hashes: @@ -615,7 +615,7 @@ class Lookyloo(): for mimetype, blobs in url.embedded_ressources.items(): for ressource_h, blob in blobs: if ressource_h == h: - return 'embedded_ressource.bin', blob, mimetype + return 'embedded_ressource.bin', BytesIO(blob.getvalue()), mimetype return None def __misp_add_vt_to_URLObject(self, obj: MISPObject) -> Optional[MISPObject]: diff --git a/website/web/__init__.py b/website/web/__init__.py index e4dc7ecf..a002dee7 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -1000,7 +1000,6 @@ def get_ressource(tree_uuid: str, node_uuid: str): to_return = BytesIO(b'Unknown Hash') filename = 'file.txt' mimetype = 'text/text' - to_return.seek(0) return send_file(to_return, mimetype=mimetype, as_attachment=True, attachment_filename=filename)