(filename: str)
| 1303 | |
| 1304 | @app.route("/tools/screenshot/<path:filename>") |
| 1305 | def tools_get_screenshot(filename: str): |
| 1306 | path = (SCREENSHOT_DIR / filename).resolve() |
| 1307 | if path.parent != SCREENSHOT_DIR.resolve() or not path.exists(): |
| 1308 | return Response("Not found", status=404) |
| 1309 | as_download = request.args.get("download") == "1" |
| 1310 | return send_file(path, mimetype="image/png", as_attachment=as_download, download_name=path.name) |
| 1311 | |
| 1312 | |
| 1313 | @app.route("/tools/screenshot/delete/<path:filename>", methods=["POST"]) |
nothing calls this directly
no outgoing calls
no test coverage detected