Skip to content

fix(docker): report a refused seed as a failed result, not a dead batch - #2359

Merged
ntohidi merged 1 commit into
developfrom
fix/2288-per-seed-refusal
Oct 12, 2026
Merged

ntohidi merged 1 commit into
developfrom
fix/2288-per-seed-refusal

Conversation

@ntohidi

@ntohidi ntohidi commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

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 /crawl or /crawl/stream request, so no seed was crawled.

Now _normalize_and_validate_seeds splits the seeds into allowed and refused:

  • Allowed seeds are crawled as before.
  • Each refused seed comes back as a failed CrawlResult (success: false) with the same opaque URL blocked (SSRF protection): ... message.
  • If every seed is refused, the request is still a 400. A single blocked URL behaves exactly as today.
  • Both paths: /crawl (refused results come first in results) and /crawl/stream (refused results are streamed first).
  • The deep-crawl stream check still counts every seed sent, so 2 seeds there is still a 400.

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: false instead 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 on develop and pass with this change.

Full deploy/docker/tests run: the same pre-existing failures/errors as on develop (they need a live server or the docker module), no new ones.

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
@ntohidi
ntohidi merged commit 3e12a96 into develop Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant