Skip to content

Commit 93e1f37

Browse files
authored
chore: reduce global speed check ratelimit (#1953)
1 parent fe62b8d commit 93e1f37

File tree

1 file changed

+2
-2
lines changed
  • apps/web/src/app/(landing)/play/checker/api

1 file changed

+2
-2
lines changed

apps/web/src/app/(landing)/play/checker/api/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { z } from "zod";
1717
export const runtime = "edge";
1818

1919
const RATE_LIMIT_WINDOW = 60; // 60 seconds
20-
const MAX_REQUESTS_PER_WINDOW = 5;
20+
const MAX_REQUESTS_PER_WINDOW = 3;
2121

2222
// Request schema validation
2323
const playCheckerRequestSchema = z.object({
@@ -208,7 +208,7 @@ export async function POST(request: Request) {
208208
if (!rateLimitResult.success) {
209209
return createErrorResponse(
210210
"RATE_LIMIT_EXCEEDED",
211-
"You have exceeded the rate limit of 10 requests per 60 seconds",
211+
`You have exceeded the rate limit of ${MAX_REQUESTS_PER_WINDOW} requests per ${RATE_LIMIT_WINDOW} seconds`,
212212
429,
213213
{
214214
limit: rateLimitResult.limit,

0 commit comments

Comments
 (0)