From aa3dce09ff68c212ac1fad33adfbfaba96290a59 Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Sun, 14 Jul 2024 13:54:32 +0200 Subject: fix: monolith not embedding SVG files correctly. Fixes #289 (#306) passing in the URL of the page to have the proper URL for resolving relative paths --- apps/workers/crawlerWorker.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'apps/workers/crawlerWorker.ts') diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts index f2a51fc8..ddf61fc8 100644 --- a/apps/workers/crawlerWorker.ts +++ b/apps/workers/crawlerWorker.ts @@ -422,15 +422,12 @@ async function archiveWebpage( jobId: string, ) { logger.info(`[Crawler][${jobId}] Will attempt to archive page ...`); - const urlParsed = new URL(url); - const baseUrl = `${urlParsed.protocol}//${urlParsed.host}`; - const assetId = newAssetId(); const assetPath = `/tmp/${assetId}`; await execa({ input: html, - })`monolith - -Ije -t 5 -b ${baseUrl} -o ${assetPath}`; + })`monolith - -Ije -t 5 -b ${url} -o ${assetPath}`; await saveAssetFromFile({ userId, @@ -442,7 +439,7 @@ async function archiveWebpage( }); logger.info( - `[Crawler][${jobId}] Done archiving the page as assertId: ${assetId}`, + `[Crawler][${jobId}] Done archiving the page as assetId: ${assetId}`, ); return assetId; -- cgit v1.2.3-70-g09d2