Repository navigation
fix(docker): report a refused seed as a failed result, not a dead batch - #2359
Merged
Merged
Conversation
One seed that fails the destination check (internal address, or a host that does not resolve) used to raise 400 for the whole /crawl or /crawl/stream request. Now the refused seed comes back as a failed CrawlResult with the same opaque message, and the other seeds are crawled. If every seed is refused, the request is still a 400. Fixes #2288
5 of 6 tasks
6 tasks done
5 of 6 tasks
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.
Fixes #2288.
Summary
One seed that fails the destination check (an internal address, or a host that does not resolve) used to raise 400 for the whole
/crawlor/crawl/streamrequest, so no seed was crawled.Now
_normalize_and_validate_seedssplits the seeds into allowed and refused:CrawlResult(success: false) with the same opaqueURL blocked (SSRF protection): ...message./crawl(refused results come first inresults) and/crawl/stream(refused results are streamed first).The SSRF check itself is unchanged: every seed is checked before any fetch, and refused seeds never reach the crawler.
Behavior change: a partly refused batch now returns 200 with per-URL
success: falseinstead of 400.Tests
deploy/docker/tests/test_seed_refusal.py(4 tests): mixed batch on/crawl, mixed batch on/crawl/stream, and all-refused still 400 on both. The two mixed-batch tests fail ondevelopand pass with this change.Full
deploy/docker/testsrun: the same pre-existing failures/errors as ondevelop(they need a live server or thedockermodule), no new ones.