Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix: moved delete rawHtml to end of controller

rafaelsideguidef8323f9b11ab
diff --git a/apps/api/src/controllers/v1/crawl-status.ts b/apps/api/src/controllers/v1/crawl-status.ts
index 1fe2fd9a2..7b94f07a0 100644
--- a/apps/api/src/controllers/v1/crawl-status.ts
+++ b/apps/api/src/controllers/v1/crawl-status.ts
@@ -100,6 +100,14 @@ export async function crawlStatusController(req: RequestWithAuth<CrawlStatusPara
nextURL.searchParams.set("limit", req.query.limit);
}
+ if (data.length > 0) {
+ if (!doneJobs[0].data.pageOptions.includeRawHtml) {
+ for (let ii = 0; ii < doneJobs.length; ii++) {
+ delete data[ii].rawHtml;
+ }
+ }
+ }
+
res.status(200).json({
status,
completed: doneJobsLength,