mirror of
https://github.com/angular/angular.git
synced 2026-11-23 07:05:14 -05:00
Previously, empty-path outlet groups in a request URL (such as `x:/(detail:2)`, `///(detail:2)`, or `x:/()`) were allowed to match without a corresponding route for that outlet name in the route configuration: 1. `processChildren` called `processSegmentGroup` for each child outlet, which immediately delegated any zero-segment group with children back to `processChildren` against the same parent `config` and `parentRoute` without matching a route. Calling `processSegment` directly in `processChildren` ensures only the root `UrlSegmentGroup` short-circuits to `processChildren`. 2. `processSegmentAgainstRoute` allowed named outlets to pierce empty-path routes for other outlets even when the route had no children to pierce into or the URL segment group had no segments or children to pierce with. 3. `matchSegmentAgainstRoute` branched into `processChildren` or returned a completed leaf match before `getOutlet(route) === outlet` was satisfied, and did not require a descendant `TreeNode` match when piercing an empty-path route for a different outlet. 4. `noLeftoversInUrl` only checked `!segmentGroup.children[outlet]` rather than `!segmentGroup.hasChildren()`, allowing unmatched zero-segment outlet groups with child outlets for other names to be treated as having no leftovers instead of throwing `NoMatch`. Together, these allowed crafted URLs with unconfigured zero-segment outlet groups to fan out across empty-path routes (#70932) or repeatedly evaluate guards and construct duplicate route snapshot subtrees across sibling outlets (#70997). Requiring every child segment group to match a route for its outlet before unwrapping children or completing a match prevents the invalid matches at the source. Fixes #70932 Fixes #70997
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT