fix: Properly send a file back on invalid hash

pull/954/head
Raphaël Vinot 2024-10-09 14:29:53 +02:00
parent c170160954
commit 844ebc6253
1 changed files with 1 additions and 1 deletions

View File

@ -1548,7 +1548,7 @@ def ressource_by_hash(sha512: str) -> Response:
filename, body, mimetype = ressource
return send_file(body, as_attachment=True, download_name=filename)
return send_file(f'Unable to find {sha512}', as_attachment=True, download_name='Hash unknown.')
return send_file(BytesIO(f'Unable to find {sha512}'.encode()), as_attachment=True, download_name='Hash unknown.')
# ################## Submit existing capture ##################