diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-07-06 21:28:48 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-07-06 21:28:48 +0800 |
| commit | 6d978a94cd24fcef435ad05cfc512a7da88a32dc (patch) | |
| tree | 09f4411c4a9e7724145b20c8f4f97eec8674d8ac /main.py | |
| parent | 77d001db4a6dfd7b232c4b08b08842379cde739d (diff) | |
test again
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |
