diff options
author | 2020-12-13 23:38:18 +0000 | |
---|---|---|
committer | 2020-12-13 23:38:18 +0000 | |
commit | 6cae737f03bba28f6023efd4a32fcdfd7009b94e (patch) | |
tree | 9ffff4bcf8efc953accdbb860b7c266267fcb40a /backend/route_manager.py | |
parent | Merge pull request #24 from python-discord/fix-data-sanitisation (diff) |
Sort routes to have constants first and path fragments last
Diffstat (limited to 'backend/route_manager.py')
-rw-r--r-- | backend/route_manager.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/backend/route_manager.py b/backend/route_manager.py index 3d83ee7..25529eb 100644 --- a/backend/route_manager.py +++ b/backend/route_manager.py @@ -20,6 +20,9 @@ def construct_route_map_from_dict(route_dict: dict) -> list: else: route_map.append(Mount(mount, routes=construct_route_map_from_dict(item))) + # Order non-capturing routes before capturing routes + route_map.sort(key=lambda route: "{" in route.path) + return route_map |