[PR #3780] [MERGED] API Cache Manager route uses case-insensitive match #4082

Closed
opened 2026-04-25 00:18:14 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3780
Author: @nichwall
Created: 1/3/2025
Status: Merged
Merged: 1/4/2025
Merged by: @advplyr

Base: masterHead: api_cache_case_insensitive


📝 Commits (2)

  • a6fd0c9 API cache manager case-insensitive match
  • f70f214 Req URL is lowercase in ApiCacheManager

📊 Changes

2 files changed (+3 additions, -1 deletions)

View changed files

📝 server/managers/ApiCacheManager.js (+2 -0)
📝 server/routers/ApiRouter.js (+1 -1)

📄 Description

Brief summary

Fix case-sensitive matching for API Cache Manager.

Which issue is fixed?

CodeQL issue from PR #3335.
Workflow output: https://github.com/advplyr/audiobookshelf/pull/3335/checks?check_run_id=35084757148

In-depth Description

https://github.com/advplyr/audiobookshelf/pull/3335#issuecomment-2567188052
This PR changes the regex path matching to be case insensitive for the API Cache Manager. Two methods I found were to force all request URLs to be lowercase, or to ensure that the regex matches against a case-insensitive string. I chose to use case-insensitive matching for now due to some routes potentially being case sensitive, such as:
DELETE /api/tags/:tag
DELETE /api/genres/:genre

How have you tested this?

I changed various API calls in the web client to use various capitalization for library API endpoints and verified that everything was still routed correctly. The API Cache Manager continued to have cache hits and return data correctly.

Screenshots

N/A


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3780 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 1/3/2025 **Status:** ✅ Merged **Merged:** 1/4/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `api_cache_case_insensitive` --- ### 📝 Commits (2) - [`a6fd0c9`](https://github.com/advplyr/audiobookshelf/commit/a6fd0c95b2a83703e12b079c65f9399d139b3aea) API cache manager case-insensitive match - [`f70f214`](https://github.com/advplyr/audiobookshelf/commit/f70f21455f773e54494650a07688117febbc134a) Req URL is lowercase in ApiCacheManager ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/ApiCacheManager.js` (+2 -0) 📝 `server/routers/ApiRouter.js` (+1 -1) </details> ### 📄 Description ## Brief summary Fix case-sensitive matching for API Cache Manager. ## Which issue is fixed? CodeQL issue from PR #3335. Workflow output: https://github.com/advplyr/audiobookshelf/pull/3335/checks?check_run_id=35084757148 ## In-depth Description https://github.com/advplyr/audiobookshelf/pull/3335#issuecomment-2567188052 This PR changes the regex path matching to be case insensitive for the API Cache Manager. Two methods I found were to force all request URLs to be lowercase, or to ensure that the regex matches against a case-insensitive string. I chose to use case-insensitive matching for now due to some routes potentially being case sensitive, such as: `DELETE /api/tags/:tag` `DELETE /api/genres/:genre` ## How have you tested this? I changed various API calls in the web client to use various capitalization for library API endpoints and verified that everything was still routed correctly. The API Cache Manager continued to have cache hits and return data correctly. ## Screenshots N/A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:14 +02:00
adam closed this issue 2026-04-25 00:18:14 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4082