Skip to content

Commit

Permalink
edit limit
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Aug 16, 2023
1 parent 5808854 commit 1bc6905
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/middleware/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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
10,
5,
key === "github" ? "1 d" : "10 s",
).limit(`${ip}:${domain}:${key}`);

Expand Down
2 changes: 1 addition & 1 deletion pages/api/edge/links/[key]/stats/[endpoint].ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function handler(req: NextRequest) {
}
const ip = ipAddress(req) || LOCALHOST_IP;
const { success } = await ratelimit(
10,
5,
key === "github" ? "1 d" : "10 s",
).limit(`${ip}:${domain}:${key}:${endpoint}`);

Expand Down

0 comments on commit 1bc6905

Please sign in to comment.