fix: address CodeQL and code quality review comments

Replace polynomial trailing-slash regex with removeTrailingSlash helper
and remove unused ModalFormFooter import in quick-add-app modal.
This commit is contained in:
Thomas Camlong committed 2026-05-29 14:54:39 +02:00
1 parent 28f31243fb
commit 1c9a63d9ef
5 files changed
+13 -6

No files matched your search

+5 -1
View File
@@ -1,7 +1,11 @@
import type { ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers";
export const removeTrailingSlash = (path: string) => {
return path.at(-1) === "/" ? path.substring(0, path.length - 1) : path;
let end = path.length;
while (end > 0 && path.charAt(end - 1) === "/") {
end--;
}
return path.slice(0, end);
};
export const extractBaseUrlFromHeaders = (