Security fixes pass #2

This commit is contained in:
2026-04-19 16:00:59 +01:00
parent 3b26292124
commit b702e26bf6
40 changed files with 305 additions and 93 deletions
+14 -9
View File
@@ -76,15 +76,20 @@ export default async function genWebHTML({ component: Main, pageProps, bundledMa
console.error = () => { };
console.info = () => { };
console.debug = () => { };
const stream = await renderToReadableStream(final_component, {
onError(error) {
if (error.message.includes('unique "key" prop'))
return;
originalConsole.error(error);
},
});
const htmlBody = await new Response(stream).text();
Object.assign(console, originalConsole);
let htmlBody;
try {
const stream = await renderToReadableStream(final_component, {
onError(error) {
if (error.message.includes('unique "key" prop'))
return;
originalConsole.error(error);
},
});
htmlBody = await new Response(stream).text();
}
finally {
Object.assign(console, originalConsole);
}
html += htmlBody;
return html;
}