fix
This commit is contained in:
@@ -92,6 +92,20 @@ function isAllowedApiUrl(req) {
|
||||
return keys.every((key) => key === 'name') && name.length >= 2 && name.length <= MAX_TEAM_NAME_LENGTH
|
||||
}
|
||||
|
||||
if (url.pathname === '/api/tss/teams/search') {
|
||||
const keys = [...params.keys()]
|
||||
const query = params.get('q') || params.get('name') || ''
|
||||
const limit = Number(params.get('limit') || 10)
|
||||
return (
|
||||
keys.every((key) => ['q', 'name', 'limit'].includes(key)) &&
|
||||
query.length >= 2 &&
|
||||
query.length <= MAX_TEAM_NAME_LENGTH &&
|
||||
Number.isInteger(limit) &&
|
||||
limit >= 1 &&
|
||||
limit <= 20
|
||||
)
|
||||
}
|
||||
|
||||
if ([...params.keys()].length) return false
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user