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.

fix

Steven Tey580885497c23
diff --git a/lib/edge-config.ts b/lib/edge-config.ts
index e6f9d81353..b5d9aa6b45 100644
--- a/lib/edge-config.ts
+++ b/lib/edge-config.ts
@@ -14,7 +14,8 @@ export const isBlacklistedDomain = async (domain: string) => {
};
export const isBlacklistedReferrer = async (referrer: string) => {
- if (/^(\d{1,3}\.){3}\d{1,3}$/.test(referrer)) {
+ const hostname = getDomainWithoutWWW(referrer) || "";
+ if (/^(\d{1,3}\.){3}\d{1,3}$/.test(hostname)) {
return true;
}
let blacklistedReferrers;
@@ -23,7 +24,7 @@ export const isBlacklistedReferrer = async (referrer: string) => {
} catch (e) {
blacklistedReferrers = [];
}
- return new RegExp(blacklistedReferrers.join("|"), "i").test(referrer);
+ return new RegExp(blacklistedReferrers.join("|"), "i").test(hostname);
};
export const isBlacklistedKey = async (key: string) => {