Skip to content

v0.1.3

Choose a tag to compare

@jirikuncar jirikuncar released this 18 Jun 23:21

Fix: trie fast-path now engages inside mounted sub-apps

FFRouter.app matched the trie against scope['path'], but Starlette's Mount does not rewrite scope['path'] — it appends the consumed prefix to scope['root_path'] and leaves path as the full request path. A mounted FFRouter therefore fed the trie the full path (/outer/x) while its trie was built from relative patterns (/x), so every lookup missed and dispatch silently fell through to the slow super().app() linear scan.

This is the same dormancy class as the 0.1.2 middleware_stack fix: results stayed correct, but the fast-path went unused inside mounts.

Fix: use get_route_path(scope), which strips root_path — exactly what Route.matches uses internally. Includes a regression test.

Full Changelog: v0.1.2...v0.1.3