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.

restructure

Steven Teyd455b2c5ad8e
diff --git a/apps/web/lib/api/links.ts b/apps/web/lib/api/links.ts
index 6ea9dc19b2..78f5469b60 100644
--- a/apps/web/lib/api/links.ts
+++ b/apps/web/lib/api/links.ts
@@ -230,6 +230,10 @@ export async function keyChecks({
code: "forbidden",
};
}
+
+ // replace all special characters for premium key checks
+ key = key.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
+
if (
(await isReservedUsername(key)) &&
(!project || project.plan === "free")
@@ -252,8 +256,6 @@ export function processKey(key: string) {
}
// remove all leading and trailing slashes from key
key = key.replace(/^\/+|\/+$/g, "");
- // replace all special characters
- key = key.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
if (key.length === 0) {
return null;
}