aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2026-07-06 21:28:48 +0800
committeraltaf-creator <dev@altafcreator.com>2026-07-06 21:28:48 +0800
commit6d978a94cd24fcef435ad05cfc512a7da88a32dc (patch)
tree09f4411c4a9e7724145b20c8f4f97eec8674d8ac /main.py
parent77d001db4a6dfd7b232c4b08b08842379cde739d (diff)
test again
Diffstat (limited to 'main.py')
-rw-r--r--main.py3
1 files changed, 2 insertions, 1 deletions
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)