This commit is contained in:
Chris Wanstrath 2025-10-02 21:48:08 -07:00
parent da61426fc9
commit eec06c1a24

View File

@ -78,6 +78,7 @@ app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => {
// app routes
//
// inject browser-nav.js into NOSE apps when loaded in a NOSE iframe
app.use("*", async (c, next) => {
await next()
@ -92,7 +93,6 @@ app.use("*", async (c, next) => {
const secFetchDest = c.req.header('Sec-Fetch-Dest')
const isIframe = secFetchDest === 'iframe'
if (!isIframe) return
const originalBody = await c.res.text()
@ -105,7 +105,6 @@ app.use("*", async (c, next) => {
modifiedBody = originalBody.replace('<body>', `<body>\n${shimScript}`)
}
// Return modified response
c.res = new Response(modifiedBody, {
status: c.res.status,
headers: c.res.headers