a simple pds frontend for listing accounts and generating invite codes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

use cloudflare header if available for rate limits

Winter b9ca5223 72d973c9

+3 -2
+3 -2
src/routes/api/invite/+server.ts
··· 9 9 const ipTimestamps = new Map<string, number[]>(); 10 10 11 11 function getIp(request: Request): string { 12 - const ip = request.headers.get('x-forwarded-for')?.split(',')[0]?.trim(); 13 - if (!ip) console.warn('[invite] no x-forwarded-for header — rate limiting under "unknown"'); 12 + const ip = request.headers.get('cf-connecting-ip') 13 + ?? request.headers.get('x-forwarded-for')?.split(',')[0]?.trim(); 14 + if (!ip) console.warn('[invite] no IP header — rate limiting under "unknown"'); 14 15 return ip ?? 'unknown'; 15 16 } 16 17