fix: remove trailing slash from GET/POST routes to prevent 307→403 redirect

FastAPI's redirect_slashes=True causes GET /api/v1/canvas to 307 redirect
to /api/v1/canvas/ — axios follows the redirect but drops the Authorization
header, resulting in 403. Fixed by declaring routes as empty string instead
of '/' so no redirect is issued. Same fix applied to nodes and edges routes.
Updated all tests to use paths without trailing slashes.
This commit is contained in:
Pouzor
2026-03-07 01:01:24 +01:00
parent a3e6a97404
commit 8a18ded2bc
6 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ async def test_login_wrong_username(client: AsyncClient, mock_credentials):
async def test_protected_route_requires_auth(client: AsyncClient):
res = await client.get("/api/v1/nodes/")
res = await client.get("/api/v1/nodes")
assert res.status_code == 403