Repository navigation
fix(js-sdk): include ignoreRobotsTxt in crawl payload - #3962
Closed
sbalagan22 wants to merge 1 commit into
Closed
sbalagan22 wants to merge 1 commit into
sbalagan22 wants to merge 1 commit into
Conversation
prepareCrawlPayload was dropping the ignoreRobotsTxt field before sending to /v2/crawl, so crawl() and startCrawl() silently ignored the option even though it is declared in CrawlOptions and supported by the API. Add it to the payload next to robotsUserAgent (the same omission fixed in firecrawl#3403) and bump to 4.29.3.
Contributor
|
Closing as a duplicate of #3959, which covers the same one-line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crawl()andstartCrawl()in the JS SDK silently dropped theignoreRobotsTxtoption: it is declared inCrawlOptionsand supported by the API, but was never written into the request body. This wires the field into the crawl payload so it reachesPOST /v2/crawl.Root cause
prepareCrawlPayload()inapps/js-sdk/firecrawl/src/v2/methods/crawl.tsbuilds the request body field by field. It has a line forrobotsUserAgentbut none forignoreRobotsTxt, even though both were added toCrawlOptionstogether.robotsUserAgenthad its own missing-payload line fixed in #3403;ignoreRobotsTxtsat on the adjacent line and was missed. Because the field was never copied intodata, the request went out without it and the crawl behaved as if the option was never passed. The Python SDK forwards this field, so the two SDKs disagreed.Fix
Add one line forwarding
request.ignoreRobotsTxtinto the payload, placed next torobotsUserAgentand guarded by the same!= nullcheck every sibling field uses. This keeps theundefinedcase out of the body (matching the existing pattern) rather than always sending the key. Version bumped to 4.29.3, matching the patch-bump convention of #3403.Test plan
Added
apps/js-sdk/firecrawl/src/__tests__/unit/v2/crawl.unit.test.ts(mirroringextract.unit.test.ts): a mockedHttpClient.postcaptures the payload. One test assertsignoreRobotsTxt: truereaches the/v2/crawlbody; one asserts it is omitted when unset. The first test fails on the base branch (payload lacks the field) and passes with the fix.npx tsupbuilds cleanly (JS + DTS).tsc --noEmitreports no errors in the changed file; the 8 pre-existing errors infeedback.ts,monitor.ts, andvalidation.tsare present on the base branch and untouched here.Fixes #3940
Summary by cubic
Forward
ignoreRobotsTxtin JS SDK crawl requests so/v2/crawlrespects the option. Aligns behavior with the API and Python SDK; addresses #3940.ignoreRobotsTxtin the crawl payload when provided.@mendable/firecrawl-jsto 4.29.3.Written for commit 24ccd73. Summary will update on new commits.