From 8df670c16133f03756e6dc6ecfa2b9515d9b0e1e Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Sun, 14 Jul 2024 13:37:55 +0200 Subject: [PATCH] monolith is not embedding SVG files correctly #289 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(-) 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;