security: disable JavaScript execution in Puppeteer for PDF generation
Some checks failed
Deploy to Production / Deploy to Server (push) Failing after 21s

This commit is contained in:
DocFast Bot 2026-02-16 15:32:34 +00:00
parent 59d563841d
commit b1135edcca

View file

@ -232,6 +232,7 @@ export async function renderPdf(
): Promise<Buffer> {
const { page, instance } = await acquirePage();
try {
await page.setJavaScriptEnabled(false);
const result = await Promise.race([
(async () => {
await page.setContent(html, { waitUntil: "domcontentloaded", timeout: 15_000 });
@ -269,6 +270,7 @@ export async function renderUrlPdf(
): Promise<Buffer> {
const { page, instance } = await acquirePage();
try {
await page.setJavaScriptEnabled(false);
const result = await Promise.race([
(async () => {
await page.goto(url, {