Skip to main content

Module http

Module http 

Source
Expand description

HTTP client helpers shared by every stage that talks to a remote.

All anodizer HTTP traffic should go through blocking_client(...) so that the User-Agent, default-roots, and timeout policy stay consistent across publishers, announcers, and the release backends.

Constants§

USER_AGENT
Canonical user-agent string sent with every anodizer HTTP request.

Functions§

async_client
Async equivalent of blocking_client.
blocking_client
Build a blocking reqwest::Client configured with the canonical UA, the requested per-request timeout, and the platform’s built-in roots.
blocking_client_no_redirect
blocking_client with redirect-following disabled: a 3xx response is returned to the caller instead of being chased. For probes whose verdict depends on whether a SPECIFIC URL resolves (e.g. a registry version page), silently following a redirect to a different page would misattribute the destination’s body to the requested resource.
body_of
Read an HTTP response body to a String, returning a descriptive placeholder on read failure.
body_of_blocking
Blocking analogue of body_of.
body_read_error_message
Format an HTTP body-read failure as a descriptive placeholder string.
github_api_base
Resolve the GitHub REST API base URL through an injected env source.
github_api_base_with_config
Like github_api_base, but honoring a configured github_urls.api (GitHub Enterprise Server) first.
sha256_url
Download url (blocking, 5-minute timeout) and return the lowercase-hex SHA-256 of its body — the canonical “fetch a release artifact, hash it” helper for publishers that must fill a digest they were not handed (e.g. the homebrew-core formula bump when no sha256: override is configured).