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

matytymaacff16c7a9d0
diff --git a/pages/api/links/index.ts b/pages/api/links/index.ts
index 7543be5b1a..f8eb883883 100644
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@ -57,8 +57,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([