Disable automatic trailing slash redirect in FastAPI

This commit is contained in:
Daniel Alves Rösel
2026-04-02 22:35:45 +04:00
committed by GitHub

View File

@@ -9,7 +9,7 @@ from app.db.session import lifespan
settings = get_settings()
app = FastAPI(title=settings.project_name, lifespan=lifespan)
app = FastAPI(title=settings.project_name, lifespan=lifespan, redirect_slashes=False)
app.add_middleware(
CORSMiddleware,