From a9c3537b88cb9c25a712ff28440e28ccf5ab1761 Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 13 Aug 2022 17:04:13 -0300 Subject: [PATCH] fix static file send --- litecord/blueprints/static.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/litecord/blueprints/static.py b/litecord/blueprints/static.py index 63ca185..c3416f4 100644 --- a/litecord/blueprints/static.py +++ b/litecord/blueprints/static.py @@ -17,7 +17,7 @@ along with this program. If not, see . """ -from quart import Blueprint, current_app as app, render_template_string +from quart import Blueprint, current_app as app, render_template_string, send_file from pathlib import Path bp = Blueprint("static", __name__) @@ -30,7 +30,10 @@ async def static_pages(path): return "no", 404 static_path = Path.cwd() / Path("static") / path - return await app.send_static_file(str(static_path)) + if static_path.exists(): + return await send_file(static_path) + else: + return "not found", 404 @bp.route("/")