Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update verify-analytics-allowed-hostnames.ts

Steven Tey19b538b63a7d
diff --git a/apps/web/lib/analytics/verify-analytics-allowed-hostnames.ts b/apps/web/lib/analytics/verify-analytics-allowed-hostnames.ts
index 8e9abce617..2246d51b4b 100644
--- a/apps/web/lib/analytics/verify-analytics-allowed-hostnames.ts
+++ b/apps/web/lib/analytics/verify-analytics-allowed-hostnames.ts
@@ -32,8 +32,9 @@ export const verifyAnalyticsAllowedHostnames = ({
.map((domain) => domain.slice(2)); // Remove the "*.", leaving just the domain
for (const domain of wildcardMatches) {
- // Allow only proper subdomains: ensure hostname ends with ".domain"
- if (hostname.endsWith(`.${domain}`)) {
+ // Allow only proper subdomains: ensure hostname ends with ".domain.com"
+ // or the hostname is exactly the domain
+ if (hostname.endsWith(`.${domain}`) || hostname === domain) {
return true;
}
}