diff options
| -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) |
