mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Add limit to bulk hash prefix
This commit is contained in:
parent
edd11cc99c
commit
e3042f7623
1 changed files with 2 additions and 1 deletions
|
@ -32,7 +32,8 @@ export async function getRating(req: Request, res: Response): Promise<Response>
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
return res.status(400).send("Bad parameter: hashPrefixes (invalid JSON)");
|
return res.status(400).send("Bad parameter: hashPrefixes (invalid JSON)");
|
||||||
}
|
}
|
||||||
if (hashPrefixes.some((hashPrefix) => !hashPrefix || !hashPrefixTester(hashPrefix))) {
|
if (hashPrefixes.length === 0 || hashPrefixes.length > 75
|
||||||
|
|| hashPrefixes.some((hashPrefix) => !hashPrefix || !hashPrefixTester(hashPrefix))) {
|
||||||
return res.status(400).send("Hash prefix does not match format requirements."); // Exit early on faulty prefix
|
return res.status(400).send("Hash prefix does not match format requirements."); // Exit early on faulty prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue