mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Ensure ember-cli does not attempt to bootstrap non-ember pages (#15168)
1b3d124a
introduced a logic change which meant that we attempted to bootstrap, even on pages without any `preloadJson` (i.e. non-ember HTML pages from Discourse). This commit restores the original logic, making sure to avoid `?.`.
This commit is contained in:
parent
44d16fcd8e
commit
ceca34aca6
@ -270,9 +270,11 @@ async function handleRequest(proxy, baseURL, req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const contentType = response.headers.get("content-type");
|
const contentType = response.headers.get("content-type");
|
||||||
|
const isHTML = contentType && contentType.startsWith("text/html");
|
||||||
const responseText = await response.text();
|
const responseText = await response.text();
|
||||||
|
const preloadJson = isHTML ? extractPreloadJson(responseText) : null;
|
||||||
|
|
||||||
if (contentType && contentType.startsWith("text/html")) {
|
if (preloadJson) {
|
||||||
const html = await buildFromBootstrap(
|
const html = await buildFromBootstrap(
|
||||||
proxy,
|
proxy,
|
||||||
baseURL,
|
baseURL,
|
||||||
|
Loading…
Reference in New Issue
Block a user