Frontend service: Pass query params to /bootdata call (#112448)

pass query params to /bootdata call
This commit is contained in:
Ashley Harrison
2025-10-15 16:51:44 +01:00
committed by GitHub
parent 75a9c8c705
commit b80c3e6760
+10 -1
View File
@@ -212,7 +212,16 @@
* Will return a rejected promise on unrecoverable errors.
**/
async function fetchBootData() {
const resp = await fetch("/bootdata");
const queryParams = new URLSearchParams(window.location.search);
// pass the search params through to the bootdata request
// this allows for overriding the theme/language etc
const bootDataUrl = new URL('/bootdata', window.location.origin);
for (const [key, value] of queryParams.entries()) {
bootDataUrl.searchParams.append(key, value);
}
const resp = await fetch(bootDataUrl);
const textResponse = await resp.text();
let rawBootData;