fastrag.ingestion.steps.fetching.http#
Shared HTTP transport for the fetching steps that speak HTTP.
Non-public: _HttpTransport and its helpers are plumbing shared by
concrete fetchers (SitemapCrawler
and any future HTTP-speaking Fetcher), not part of this package’s public
surface. Ported from src/fastrag/steps/fetching/http.py — connection
reuse, user agent, timeouts, redirect following, and transient-status
classification are unchanged; only the shape around it differs, since the
new Fetcher is a plain SourceStep rather than a fingerprinted
dataclass, so this transport is held as an attribute instead of mixed in via
inheritance.
Functions
|
Return a normalized identifier for |
Classes
|
The raw HTTP response for one fetched URI, before it becomes a |
- class fastrag.ingestion.steps.fetching.http.FetchedPage(uri, content, content_type, etag, last_modified, status_code)[source]#
Bases:
objectThe raw HTTP response for one fetched URI, before it becomes a
Source.
- fastrag.ingestion.steps.fetching.http.normalize_uri(uri)[source]#
Return a normalized identifier for
uri, used asSource.id.Lowercases the scheme and host, adds
https://when the caller typed a bare host (no://), drops a default port for the scheme, drops the fragment, and drops a trailing slash from the path. The scheme is kept (unlikeAPI.md’s illustrativenormalized("https://b.com/") == "b.com"): dropping it would collidehttp://a.comandhttps://a.com, which are not the same resource.