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.

edit rate limit

Steven Tey2947a24998df
diff --git a/lib/middleware/link.ts b/lib/middleware/link.ts
index 328f40a8ca..9300765219 100644
--- a/lib/middleware/link.ts
+++ b/lib/middleware/link.ts
@@ -24,7 +24,7 @@ export default async function LinkMiddleware(
const ip = ipAddress(req) || LOCALHOST_IP;
const { success } = await ratelimit(
// 25 redirects / day for dub.sh/github demo link, 10 redirects / 10s for other dub.sh links
- key === "github" ? 25 : 10,
+ 10,
key === "github" ? "1 d" : "10 s",
).limit(`${ip}:${domain}:${key}`);
diff --git a/pages/api/edge/links/[key]/stats/[endpoint].ts b/pages/api/edge/links/[key]/stats/[endpoint].ts
index a282b21cec..cb8ef4b162 100644
--- a/pages/api/edge/links/[key]/stats/[endpoint].ts
+++ b/pages/api/edge/links/[key]/stats/[endpoint].ts
@@ -21,7 +21,7 @@ export default async function handler(req: NextRequest) {
if (domain === "dub.sh") {
const ip = ipAddress(req) || LOCALHOST_IP;
const { success } = await ratelimit(
- key === "github" ? 20 : 10,
+ 10,
key === "github" ? "1 d" : "10 s",
).limit(`${ip}:${domain}:${key}:${endpoint}`);