Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mounting dynamic routes. FIxes #250 #288

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
comment
  • Loading branch information
davidmartos96 committed Sep 15, 2022
commit fc6a2088a9e01b83e6ab58d89d68c9b8c509fe50
4 changes: 4 additions & 0 deletions pkgs/shelf_router/lib/src/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ class Router {

// first slash is always in request.handlerPath
final path = prefix.substring(1);

// Prefix it with two underscores to avoid conflicts
// with user defined path parameters
const pathParam = '__path';

if (prefix.endsWith('/')) {
_all(
prefix + '<$pathParam|[^]*>',
Expand Down