api refactor: force access control and handle subpaths

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-02-14 11:25:29 -05:00
parent 877c488fa8
commit dbf20d1388
19 changed files with 92 additions and 45 deletions
+3 -3
View File
@@ -136,16 +136,16 @@ async function getLocaleData(desiredLocale = null) {
// primary
let json = {};
try {
let res = await fetch(`/file=html/locale_${localeData.locale}.json`);
let res = await fetch(`${window.subpath}/file=html/locale_${localeData.locale}.json`);
if (!res || !res.ok) {
localeData.locale = 'en';
res = await fetch(`/file=html/locale_${localeData.locale}.json`);
res = await fetch(`${window.subpath}/file=html/locale_${localeData.locale}.json`);
}
json = await res.json();
} catch { /**/ }
try {
const res = await fetch(`/file=html/override_${localeData.locale}.json`);
const res = await fetch(`${window.subpath}/file=html/override_${localeData.locale}.json`);
if (res && res.ok) json.override = await res.json();
} catch { /**/ }