diff --git a/worker/src/main.ts b/worker/src/main.ts index ccf4438..0d1bcf5 100644 --- a/worker/src/main.ts +++ b/worker/src/main.ts @@ -17,9 +17,6 @@ function validateEnvironment(env: Record): Config { } const API = new URL('https://api.cloudflare.com/client/v4/') -const RATE_LIMIT_MS = 30_000 - -let lastRequest = 0 export default { async fetch(req: Request, env: Record, ctx: unknown): Promise { @@ -42,18 +39,6 @@ export default { return new Response('Unauthorized', { status: 401 }) } - // Throttle updates to not overload the Cloudflare API - const now = Date.now() - if (now - lastRequest < RATE_LIMIT_MS) { - return new Response('Too Many Requests', { - status: 429, - headers: { - 'Retry-After': Math.ceil((lastRequest + RATE_LIMIT_MS - now) / 1000).toString() - } - }) - } - lastRequest = now - // TOOD support IPv6 if (!/(\d+\.){3}(\d+)/.test(remoteAddress)) { return new Response('Bad Request', { status: 400 })