Skip to content

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

fix: robots.txt laoding

Gergő Móriczc5597bc7221f
diff --git a/apps/api/src/controllers/crawl.ts b/apps/api/src/controllers/crawl.ts
index 4f3c5f22a..5c1e04287 100644
--- a/apps/api/src/controllers/crawl.ts
+++ b/apps/api/src/controllers/crawl.ts
@@ -95,25 +95,22 @@ export async function crawlController(req: Request, res: Response) {
await logCrawl(id, team_id);
- let robots;
-
- try {
- robots = await this.getRobotsTxt();
- } catch (_) {}
-
const sc: StoredCrawl = {
originUrl: url,
crawlerOptions,
pageOptions,
team_id,
- robots,
createdAt: Date.now(),
};
- await saveCrawl(id, sc);
-
const crawler = crawlToCrawler(id, sc);
+ try {
+ sc.robots = await crawler.getRobotsTxt();
+ } catch (_) {}
+
+ await saveCrawl(id, sc);
+
const sitemap = sc.crawlerOptions?.ignoreSitemap ? null : await crawler.tryGetSitemap();
if (sitemap !== null) {