mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Fix:API /libraries/:library/items validate limit and page are positive integers #3459
This commit is contained in:
parent
58f4a0cfbb
commit
567a9a4e58
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user