Expand description
HTTP client, metadata probing and range requests (PRD §6).
Two rules drive this module:
- Never trust the server. Headers are parsed defensively, sizes are
sanity-checked,
Content-Rangeis verified against what we asked for, and a server that ignoresRangeis detected rather than believed. - Never leak credentials. URLs are redacted before they can reach a log
line, and
Authorizationis dropped across a cross-host redirect.
Structs§
- Http
Config - Primed
- What a priming probe learned, plus the response body it opened.
- Remote
Info - Everything we learn about the remote resource before transferring it.
Constants§
Functions§
- build_
client - get_
range - A ranged
GET, with the response validated against what we asked for. - header
- parse_
content_ range bytes 0-1023/4096→(0, 1023, Some(4096)).*total →None.- parse_
retry_ after Retry-Afterin delta-seconds form. The HTTP-date form is rare in practice and parsing dates without a date library invites bugs, so we fall back to our own backoff for it rather than guess.- probe
- Ask the server what it has, without downloading it.
- probe_
priming - Probe and start the download in a single request.
- redact
- Strip userinfo and query before a URL can reach a log line (PRD §36).