mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-27 16:29:30 +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
|
||||
*/
|
||||
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}`)
|
||||
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) {
|
||||
return res.status(404).send('Library not found')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user