diff --git a/app/assets/javascripts/discourse/lib/bootstrap-json/index.js b/app/assets/javascripts/discourse/lib/bootstrap-json/index.js index 6cea5eeb84..bf3b1cc7c4 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,