fix(target-profile-manager): enhance domain matching to support bidirectional checks

This commit is contained in:
2026-04-06 11:56:55 +00:00
parent ad45d1b8b9
commit f29ed9757e

View File

@@ -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;
}
}
}