Skip to content

Commit

Permalink
whats req.ip ??
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeep-ghosh committed Jul 1, 2024
1 parent 92b2000 commit 1d24ec6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/api/drop/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 1d24ec6

Please sign in to comment.