46
// Only emit subdomain patterns if there are actually subdomains (more than 2 parts)
47
if (!isIP && domainParts.length > 2) {
49
>
// For example, foo.bar.example.com -> *.bar.example.com, *.example.com
50
>
for (let i = 0; i < domainParts.length - 2; i++) {
51
>
const wildcardAuthority = '*.' + domainParts.slice(i + 1).join('.');
52
>
const wildcardPattern = normalized.with({
53
>
authority: wildcardAuthority,
54
>
path: '',
55
>
query: '',
56
>
fragment: ''
57
>
}).toString(true);
58
>
patterns.add(wildcardPattern);
59
>
}
60
>
}
61
62
// Path patterns (if there's a non-trivial path)