diff --git a/index.ts b/index.ts index 91f1bd4..26696fb 100644 --- a/index.ts +++ b/index.ts @@ -144,8 +144,18 @@ app.get("/blazed", async (req, res) => { if (xhr.status !== 200) { console.error("XHR request failed:", xhr.status, xhr.statusText); - res.send(` -
Reason: ${xhr.status} ${xhr.statusText}
The page you are seeing could not be correctly blazed due to these webpage characteristics. Blaze served anyway a lightweight version of the page. @@ -203,7 +219,9 @@ app.get("/blazed", async (req, res) => { const referenceElement = document.body.firstChild; document.body.insertBefore(blazeDisclaimer, referenceElement); - return res.send(document.toString()); + const blazedPage = minify(document.toString(), minifierOptions); + + return res.send(blazedPage); } //TODO: find if there are more performant ways to remove images or evaluate if is the case to remove images