Fix:API /libraries/:library/items validate limit and page are positive integers #3459

This commit is contained in:
advplyr 2024-09-26 16:48:38 -05:00
parent 58f4a0cfbb
commit 567a9a4e58

View File

@ -503,6 +503,14 @@ class LibraryController {
collapseseries: req.query.collapseseries === '1',
include: include.join(',')
}
if (!Number.isInteger(payload.limit) || payload.limit < 0) {
return res.status(400).send('Invalid request. Limit must be a positive integer')
}
if (!Number.isInteger(payload.page) || payload.page < 0) {
return res.status(400).send('Invalid request. Page must be a positive integer')
}
payload.offset = payload.page * payload.limit
// TODO: Temporary way of handling collapse sub-series. Either remove feature or handle through sql queries