aggressive data collection :PP
This commit is contained in:
+5
-2
@@ -5,11 +5,14 @@ import tailwindcss from '@tailwindcss/vite'
|
||||
const MAX_TEAM_NAME_LENGTH = 80
|
||||
|
||||
function isAllowedApiUrl(req) {
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD') return false
|
||||
|
||||
const url = new URL(req.url, 'http://localhost')
|
||||
const params = url.searchParams
|
||||
|
||||
if (url.pathname === '/api/viewers' && (req.method === 'GET' || req.method === 'HEAD')) return true
|
||||
if (url.pathname === '/api/viewers/event' && req.method === 'POST') return true
|
||||
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD') return false
|
||||
|
||||
if (url.pathname === '/api/tss/leaderboard/teams') {
|
||||
const keys = [...params.keys()]
|
||||
const limit = Number(params.get('limit') || 100)
|
||||
|
||||
Reference in New Issue
Block a user