mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-29 01:08:56 +01:00
set library id lowercase make more compatible
This commit is contained in:
parent
d7e810fc2f
commit
c2a4d45fdb
@ -1314,12 +1314,12 @@ class LibraryController {
|
|||||||
* @param {NextFunction} next
|
* @param {NextFunction} next
|
||||||
*/
|
*/
|
||||||
async middleware(req, res, next) {
|
async middleware(req, res, next) {
|
||||||
if (!req.user.checkCanAccessLibrary(req.params.id)) {
|
if (!req.user.checkCanAccessLibrary(req.params.id.toLowerCase())) {
|
||||||
Logger.warn(`[LibraryController] Library ${req.params.id} not accessible to user ${req.user.username}`)
|
Logger.warn(`[LibraryController] Library ${req.params.id} not accessible to user ${req.user.username}`)
|
||||||
return res.sendStatus(403)
|
return res.sendStatus(403)
|
||||||
}
|
}
|
||||||
|
|
||||||
const library = await Database.libraryModel.findByIdWithFolders(req.params.id)
|
const library = await Database.libraryModel.findByIdWithFolders(req.params.id.toLowerCase())
|
||||||
if (!library) {
|
if (!library) {
|
||||||
return res.status(404).send('Library not found')
|
return res.status(404).send('Library not found')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user