Skip to content

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

fix(api): stop warning about skipTlsVerification on file-engine scrapes (#4497)

Abimael Martelldc2adaeab9e2
diff --git a/apps/api/src/__tests__/snips/v2/scrape-image-ocr.test.ts b/apps/api/src/__tests__/snips/v2/scrape-image-ocr.test.ts
index deb34e3a7..d453ed407 100644
--- a/apps/api/src/__tests__/snips/v2/scrape-image-ocr.test.ts
+++ b/apps/api/src/__tests__/snips/v2/scrape-image-ocr.test.ts
@@ -495,6 +495,7 @@ describeIf(SHOULD_RUN)("Image OCR (f-e and fire-pdf dependent)", () => {
expect(response.metadata.statusCode).toBe(200);
// An image is not a PDF: no page count is reported for it.
expect(response.metadata.numPages).toBeUndefined();
+ expect(response.warning).toBeUndefined();
},
scrapeTimeout,
);
diff --git a/apps/api/src/__tests__/snips/v2/scrape.test.ts b/apps/api/src/__tests__/snips/v2/scrape.test.ts
index b1fca7391..dbd201e44 100644
--- a/apps/api/src/__tests__/snips/v2/scrape.test.ts
+++ b/apps/api/src/__tests__/snips/v2/scrape.test.ts
@@ -1505,6 +1505,8 @@ describe("Scrape tests", () => {
expect(response.markdown).toContain("PDF Test File");
expect(response.metadata.title).toContain("PDF Test Page");
expect(response.metadata.numPages).toBe(1);
+ // A complete parse must not carry the partial-scrape warning.
+ expect(response.warning).toBeUndefined();
},
scrapeTimeout,
);
diff --git a/apps/api/src/scraper/scrapeURL/engines/index.ts b/apps/api/src/scraper/scrapeURL/engines/index.ts
index cb880524b..335a60c9e 100644
--- a/apps/api/src/scraper/scrapeURL/engines/index.ts
+++ b/apps/api/src/scraper/scrapeURL/engines/index.ts
@@ -489,6 +489,11 @@ const engineOptions: {
},
quality: 5,
},
+ // The file engines (pdf, document, image) pass skipTlsVerification through
+ // to their direct downloads, and a browser handoff already applied it
+ // upstream, so they declare it supported: otherwise every cache-miss file
+ // scrape carries a misleading "may be partial" warning, since v2 defaults
+ // the option to true.
pdf: {
features: {
actions: false,
@@ -503,7 +508,7 @@ const engineOptions: {
atsv: false,
location: false,
mobile: false,
- skipTlsVerification: false,
+ skipTlsVerification: true,
useFastMode: true,
stealthProxy: true, // kinda...
branding: false,
@@ -525,7 +530,7 @@ const engineOptions: {
atsv: false,
location: false,
mobile: false,
- skipTlsVerification: false,
+ skipTlsVerification: true,
useFastMode: true,
stealthProxy: true, // kinda...
branding: false,
@@ -547,7 +552,7 @@ const engineOptions: {
atsv: false,
location: false,
mobile: false,
- skipTlsVerification: false,
+ skipTlsVerification: true,
useFastMode: true,
stealthProxy: true, // kinda...
branding: false,