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 #223

matytyma0d5ea94bd53f
diff --git a/pages/api/links/[key]/index.ts b/pages/api/links/[key]/index.ts
index ee5f972960..2e66983ade 100644
--- a/pages/api/links/[key]/index.ts
+++ b/pages/api/links/[key]/index.ts
@@ -41,8 +41,8 @@ export default withLinksAuth(
if (domainBlacklisted) {
return res.status(422).end("Invalid url.");
}
- } else if (key === "/") {
- return res.status(422).end("Key cannot be '/'.");
+ } else if (key.split("").every((char) => char === "/")) {
+ return res.status(422).end("Key must contain characters other than '/'.");
}
const [response, invalidFavicon] = await Promise.allSettled([