fix: respect BASE_PATH in AI chat fetch and pdfjs worker assets

This commit is contained in:
Anthony Stirling
2026-06-06 21:21:24 +01:00
parent 940cb2fc44
commit 0b575ed841
6 changed files with 33 additions and 20 deletions
+4 -1
View File
@@ -1,6 +1,9 @@
import { URL_TO_TOOL_MAP } from "@app/utils/urlMapping";
import { BASE_PATH } from "@app/constants/app";
const SUBPATH = import.meta.env.VITE_RUN_SUBPATH.replace(/^\/|\/$/g, ""); // "app" or ""
// BASE_PATH is "/bpp" or "" (no trailing slash). Strip the leading slash
// to match the legacy SUBPATH shape used below ("bpp" or "").
const SUBPATH = BASE_PATH.replace(/^\//, "");
/**
* Normalize pathname by stripping subpath prefix and trailing slashes