v0.0.2: split api_bp into upload/process/download modules, Connection: close, upload tests (13 new, 106 total)
Deploy drhider / validate (push) Waiting to run

This commit is contained in:
2026-07-13 09:15:38 +04:00
parent 345448caa4
commit c35e8da357
7 changed files with 387 additions and 97 deletions
+21
View File
@@ -0,0 +1,21 @@
"""
GET /api/download/{sid} — скачать ZIP и удалить сессию.
После этого вызова — всё чисто, памяти ноль.
"""
import io
from flask import Blueprint, send_file, jsonify
from session import get_result, cleanup
download_bp = Blueprint("download", __name__, url_prefix="/api")
@download_bp.route("/download/<sid>", methods=["GET"])
def download(sid):
zip_data = get_result(sid)
if zip_data is None:
return jsonify({"ok": False, "error": "Not found"}), 404
cleanup(sid)
return send_file(io.BytesIO(zip_data), mimetype="application/zip",
as_attachment=True, download_name="drhider_output.zip")