mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Check for array in non hash prefix method
This commit is contained in:
parent
60a118f391
commit
0c64f4b006
1 changed files with 4 additions and 0 deletions
|
@ -266,6 +266,10 @@ async function handleGetSegments(req: Request, res: Response): Promise<Segment[]
|
|||
: req.query.category
|
||||
? [req.query.category]
|
||||
: ['sponsor'];
|
||||
if (!Array.isArray(categories)) {
|
||||
res.status(400).send("Categories parameter does not match format requirements.");
|
||||
return false;
|
||||
}
|
||||
|
||||
let service: Service = req.query.service ?? req.body.service ?? Service.YouTube;
|
||||
if (!Object.values(Service).some((val) => val == service)) {
|
||||
|
|
Loading…
Reference in a new issue