Skip to content

Commit

Permalink
Revert case-insensitive cache manager update in #3780
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Jan 20, 2025
1 parent 64992b3 commit 6745efc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions server/managers/ApiCacheManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class ApiCacheManager {
Logger.debug(`[ApiCacheManager] Skipping cache for random sort`)
return next()
}
// Force URL to be lower case for matching against routes
req.url = req.url.toLowerCase()

const key = { user: req.user.username, url: req.url }
const stringifiedKey = JSON.stringify(key)
Logger.debug(`[ApiCacheManager] count: ${this.cache.size} size: ${this.cache.calculatedSize}`)
Expand Down
2 changes: 1 addition & 1 deletion server/routers/ApiRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ApiRouter {
//
// Library Routes
//
this.router.get(/^\/libraries/i, this.apiCacheManager.middleware)
this.router.get(/^\/libraries/, this.apiCacheManager.middleware)
this.router.post('/libraries', LibraryController.create.bind(this))
this.router.get('/libraries', LibraryController.findAll.bind(this))
this.router.get('/libraries/:id', LibraryController.middleware.bind(this), LibraryController.findOne.bind(this))
Expand Down

0 comments on commit 6745efc

Please sign in to comment.