Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ensure ember-cli does not attempt to bootstrap non-ember pages (#15168)

David Taylorceca34aca6cc
diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
index 6cea5eeb848..bf3b1cc7c47 100644
--- a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
+++ b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js
@@ -270,9 +270,11 @@ async function handleRequest(proxy, baseURL, req, res) {
}
const contentType = response.headers.get("content-type");
+ const isHTML = contentType && contentType.startsWith("text/html");
const responseText = await response.text();
+ const preloadJson = isHTML ? extractPreloadJson(responseText) : null;
- if (contentType && contentType.startsWith("text/html")) {
+ if (preloadJson) {
const html = await buildFromBootstrap(
proxy,
baseURL,