Skip to content

Commit

Permalink
fix: allow paths starting with @
Browse files Browse the repository at this point in the history
  • Loading branch information
kgamecarter committed Apr 16, 2022
1 parent f9b5e5f commit 8b09896
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- kantuni
- kddnewton
- kentcdodds
- kgamecarter
- kkirsche
- koojaa
- KutnerUri
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router/lib/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ function compilePath(
: // Otherwise, match a word boundary or a proceeding /. The word boundary restricts
// parent routes to matching only their own words and nothing more, e.g. parent
// route "/home" should not match "/home2".
// Additionally, allow paths starting with `.`, `-`, `~`, and url-encoded entities,
// Additionally, allow paths starting with `@`, `.`, `-`, `~`, and url-encoded entities,
// but do not consume the character in the matched path so they can match against
// nested paths.
"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)";
"(?:(?=[@.~-]|%[0-9A-F]{2})|\\b|\\/|$)";
}

let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
Expand Down

0 comments on commit 8b09896

Please sign in to comment.