From 1d24ec6baf2799481b9dc926a43be56b9b7f5c76 Mon Sep 17 00:00:00 2001 From: Rajdeep Ghosh Date: Mon, 1 Jul 2024 20:07:54 +0530 Subject: [PATCH] whats req.ip ?? --- src/app/api/drop/route.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/api/drop/route.ts b/src/app/api/drop/route.ts index 4cce115..934e822 100644 --- a/src/app/api/drop/route.ts +++ b/src/app/api/drop/route.ts @@ -10,7 +10,10 @@ import type { UploadAPIReqPayload } from '@/types'; async function POST(req: NextRequest) { const ip = req.ip ?? '127.0.0.1'; + console.log('POST', ip); + console.log('request ip', req.ip); + const { limit, remaining, reset } = await ratelimit.upload.limit(ip); const ratelimitHeaders = { @@ -82,7 +85,10 @@ async function POST(req: NextRequest) { async function GET(req: NextRequest) { const ip = req.ip ?? '127.0.0.1'; + console.log('GET', ip); + console.log('request ip', req.ip); + const { limit, remaining, reset } = await ratelimit.download.limit(ip); const ratelimitHeaders = {