Skip to content

Commit 2c638d9

Browse files
committed
Update outbound-domains.js
1 parent 36d3990 commit 2c638d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/script/src/extensions/outbound-domains.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ const initOutboundDomains = () => {
1818
const normalizedUrlHostname = normalizeDomain(urlHostname);
1919
const normalizedDomain = normalizeDomain(domain);
2020

21-
// if wildcard domain, check if the url hostname ends with the domain
21+
// if wildcard domain, check if the url hostname ends with the apex domain
2222
if (normalizedDomain.startsWith('*.')) {
23-
return normalizedUrlHostname.endsWith(normalizedDomain.slice(2));
23+
const apexDomain = normalizedDomain.slice(2);
24+
return normalizedUrlHostname.endsWith(`.${apexDomain}`);
2425
}
2526

2627
// check for exact match after removing www.

0 commit comments

Comments
 (0)