From cee28f1ee64e2f236ef12e1b72e22da6e588746b Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 14 Dec 2022 15:06:56 +0300 Subject: [PATCH] update sanic --- autoindex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoindex.py b/autoindex.py index 3054abc..c595530 100644 --- a/autoindex.py +++ b/autoindex.py @@ -6,7 +6,7 @@ from pathlib import Path from sanic import Sanic from sanic.request import Request from sanic.response import text, html, file_stream, redirect -from sanic.exceptions import abort +from sanic.exceptions import NotFound from sanic_cors import CORS from utils import get_j2env, get_sort_icon, get_sort_link, resolve_path, list_dir @@ -50,7 +50,7 @@ async def index(request: Request, path=''): elif resolved_path.is_file(): return await file_stream(resolved_path) - abort(404, 'Path was not found') + raise NotFound('Path was not found') app.get('/')(index)