Skip to main content

Module http

Module http 

Source
Expand description

The shared HTTP client.

Every outbound request is checked against an explicit URL allowlist before it is sent. Service crates register the read-only URLs they need. The order-submission URL is deliberately not registered unless ordering is enabled in config, so an accidental or injected call to it fails closed with ErrorKind::UrlNotAllowed instead of reaching Grab.

Cookies are sent as a manually built Cookie: header (reqwest’s cookie store is off), filtered per request host and path the way a browser does.

Structs§

Allowlist
A set of allowed URLs. Service crates build one and register their URLs.
Client
Shared state for building requests, minus the hydra token (which the higher-level client refreshes).
RawCookie
A cookie parsed from a Set-Cookie response header.
Request
A prepared request the client will send if its URL is allowlisted.

Enums§

Hydra
Whether a call needs the hydra device JWT header.
Rule
How a URL may be matched by the allowlist.

Constants§

DEFAULT_UA

Functions§

parse_http_date
Parse an HTTP date (Sun, 06 Nov 1994 08:49:37 GMT, also the 06-Nov-1994 cookie variant) into Unix seconds.
parse_set_cookie
Parse one Set-Cookie header received from host into a RawCookie.

Type Aliases§

SharedClient
A shareable handle so service code can hold the client cheaply.