Skip to main content

client_with

Function client_with 

Source
pub fn client_with(settings: impl Fn(ClientBuilder) -> ClientBuilder) -> Client
Expand description

A client built from the site’s own settings (timeouts, headers, redirect rules, proxy), for a site with nowhere to return an error to. Never fails. The settings come as a function because a builder is used up by build(), and a build that fails (the certificates the probe saw are gone since: a bundle removed or replaced while the server runs) is tried again with the same settings and nothing to trust, so a site’s redirect rule or no_proxy is never lost and every https request still fails closed. Only if that fails too, client is the last step.