mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 17:54:54 +02:00
set library id lowercase make more compatible
This commit is contained in:
parent
d7e810fc2f
commit
c2a4d45fdb
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue