From 6d978a94cd24fcef435ad05cfc512a7da88a32dc Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Mon, 6 Jul 2026 21:28:48 +0800 Subject: test again --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 2ac0118..60c6df4 100644 --- a/main.py +++ b/main.py @@ -45,10 +45,11 @@ with open("index.html") as f: @app.middleware("http") async def force_trailing_slash(request: fastapi.Request, call_next): path = request.url.path + print("urlpath", path) if not path.endswith("/") and not Path(path).suffix: new_url = str(request.url.replace(path=path + "/")) - print("redirect to", new_url) + print("redirect to", new_url, "from", request.url) return fastapi.responses.RedirectResponse(url=new_url, status_code=301) response = await call_next(request) -- cgit v1.2.3