Skip to content

[repo-monitor] High: robots.txt fetched with no timeout — hangs indefinitely, ignores FetcherConfig #3

@Liohtml

Description

@Liohtml

Summary

fetch_robots uses reqwest::get() which creates a default HTTP client with no timeout and ignores all FetcherConfig settings (proxy, TLS, custom headers), potentially hanging the entire crawl setup indefinitely.

Location

  • File: src/spiders/robots.rs
  • Line(s): 25

Severity

High

Details

let rules = match reqwest::get(&url).await {

reqwest::get creates a brand-new default client with no timeout. If the target's robots.txt endpoint hangs, the entire crawl setup blocks forever. This client also ignores any proxy, TLS certificate validation settings, and custom headers configured in FetcherConfig.

Suggested Fix

Use a purpose-built client with a short timeout:

let client = reqwest::Client::builder()
    .timeout(Duration::from_secs(10))
    .build()
    .unwrap_or_default();
let rules = match client.get(&url).send().await {

Or reuse the spider's existing Fetcher instance.


Automated finding by repo-monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions