fix(target-profile-manager): enhance domain matching to support bidirectional checks
This commit is contained in:
@@ -280,12 +280,13 @@ export class TargetProfileManager {
|
||||
if (route.name && profile.routeRefs.includes(route.name)) return true;
|
||||
}
|
||||
|
||||
// 2. Domain match
|
||||
// 2. Domain match (bidirectional: profile-specific + route-wildcard, or vice versa)
|
||||
if (profile.domains?.length) {
|
||||
const routeDomains: string[] = (route.match as any)?.domains || [];
|
||||
for (const profileDomain of profile.domains) {
|
||||
for (const routeDomain of routeDomains) {
|
||||
if (this.domainMatchesPattern(routeDomain, profileDomain)) return true;
|
||||
if (this.domainMatchesPattern(routeDomain, profileDomain) ||
|
||||
this.domainMatchesPattern(profileDomain, routeDomain)) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user