DEV: Proxy `mobile_view` param to /bootstrap.json (#17934)
Without this it took an extra request for the setting to take in dev mode. Also, append `preview_theme_id` only when present.
This commit is contained in:
parent
2a1de963ac
commit
5043669d05
|
@ -241,13 +241,21 @@ async function buildFromBootstrap(proxy, baseURL, req, response, preload) {
|
|||
|
||||
const forUrlSearchParams = new URL(req.url, "https://dummy-origin.invalid")
|
||||
.searchParams;
|
||||
|
||||
const mobileView = forUrlSearchParams.get("mobile_view");
|
||||
if (mobileView) {
|
||||
url.searchParams.append("mobile_view", mobileView);
|
||||
}
|
||||
|
||||
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);
|
||||
if (reqUrlPreviewThemeId) {
|
||||
url.searchParams.append("preview_theme_id", reqUrlPreviewThemeId);
|
||||
}
|
||||
|
||||
const res = await fetch(url, { headers: req.headers });
|
||||
const json = await res.json();
|
||||
|
|
Loading…
Reference in New Issue