mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-16 13:51:14 +01:00
Fix req.query check and response
This commit is contained in:
1 parent
3c9966e849
commit
1def32aa50
1 file changed
+4
-4
@@ -1424,7 +1424,7 @@ class LibraryController {
|
||||
* GET: /api/library/:id/download
|
||||
* Downloads multiple library items
|
||||
*
|
||||
* @param {LibraryItemControllerRequest} req
|
||||
* @param {LibraryControllerRequest} req
|
||||
* @param {Response} res
|
||||
*/
|
||||
async downloadMultiple(req, res) {
|
||||
@@ -1433,8 +1433,9 @@ class LibraryController {
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
if(req.query.ids === undefined || req.query.ids === '') {
|
||||
res.status(400).send('Library items not found')
|
||||
if (!req.query.ids || typeof req.query.ids !== 'string') {
|
||||
res.status(400).send('Invalid request. ids must be a string')
|
||||
return
|
||||
}
|
||||
|
||||
const itemIds = req.query.ids.split(',')
|
||||
@@ -1467,7 +1468,6 @@ class LibraryController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {RequestWithUser} req
|
||||
|
||||
Reference in new issue
Block a user