mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:57:36 +08:00
DEV: Allow safe_mode and preview_theme_id to work via ember-cli proxy (#17928)
This commit is contained in:
parent
3d070b4a32
commit
b6c6c803c2
|
@ -239,6 +239,16 @@ async function buildFromBootstrap(proxy, baseURL, req, response, preload) {
|
||||||
let url = new URL(`${proxy}${baseURL}bootstrap.json`);
|
let url = new URL(`${proxy}${baseURL}bootstrap.json`);
|
||||||
url.searchParams.append("for_url", req.url);
|
url.searchParams.append("for_url", req.url);
|
||||||
|
|
||||||
|
const forUrlSearchParams = new URL(req.url, "https://dummy-origin.invalid")
|
||||||
|
.searchParams;
|
||||||
|
const reqUrlSafeMode = forUrlSearchParams.get("safe_mode");
|
||||||
|
if (reqUrlSafeMode) {
|
||||||
|
url.searchParams.append("safe_mode", reqUrlSafeMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
const reqUrlPreviewThemeId = forUrlSearchParams.get("preview_theme_id");
|
||||||
|
url.searchParams.append("preview_theme_id", reqUrlPreviewThemeId);
|
||||||
|
|
||||||
const res = await fetch(url, { headers: req.headers });
|
const res = await fetch(url, { headers: req.headers });
|
||||||
const json = await res.json();
|
const json = await res.json();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user