Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crawl4ai/deep_crawling/bfs_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ async def can_process_url(self, url: str, depth: int) -> bool:
raise ValueError("Missing scheme or netloc")
if parsed.scheme not in ("http", "https"):
raise ValueError("Invalid scheme")
if "." not in parsed.netloc:
raise ValueError("Invalid domain")
except Exception as e:
self.logger.warning(f"Invalid URL: {url}, error: {e}")
return False
Expand Down
8 changes: 8 additions & 0 deletions tests/deep_crawling/test_deep_crawl_resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,14 @@ async def test_filter_chain_still_works(self):
assert await strategy.can_process_url("https://example.com/blog/post1", 1) == True
assert await strategy.can_process_url("https://other.com/blog/post1", 1) == False

@pytest.mark.asyncio
async def test_single_label_hostname_is_valid(self):
"""Single-label hostnames can reach the configured filter chain."""
filter_chain = FilterChain([DomainFilter(allowed_domains=["intranet"])])
strategy = BFSDeepCrawlStrategy(max_depth=1, filter_chain=filter_chain)

assert await strategy.can_process_url("https://intranet/docs", 1) is True

@pytest.mark.asyncio
async def test_url_scorer_still_works(self):
"""URL scoring integration unchanged."""
Expand Down