Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

feat(router): make the router immune to missing trailing slashes #148

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def main(args):
# Get & Fetch access
api_request("get", f"{args.endpoint}/users/{user_id}/", superuser_auth)
api_request("get", f"{args.endpoint}/users/", superuser_auth)
# Check that redirect is working
api_request("get", f"{args.endpoint}/users", superuser_auth)
# Modify access
new_pwd = "my_new_pwd" # noqa S105
api_request("patch", f"{args.endpoint}/users/{user_id}/", superuser_auth, {"password": new_pwd})
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/api_v1/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from app.api.api_v1.endpoints import code, guidelines, login, repos, users

api_router = APIRouter()
api_router = APIRouter(redirect_slashes=True)
api_router.include_router(login.router, prefix="/login", tags=["login"])
api_router.include_router(users.router, prefix="/users", tags=["users"])
api_router.include_router(repos.router, prefix="/repos", tags=["repos"])
Expand Down
Loading