From c2a4d45fdbde744ed6967dc3c26f52981ea00792 Mon Sep 17 00:00:00 2001 From: unl0ck Date: Sun, 10 Nov 2024 12:12:58 +0000 Subject: [PATCH] set library id lowercase make more compatible --- server/controllers/LibraryController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index 0bd499f1..961472d5 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -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') }