MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / create_http_client

Function create_http_client

rust/src/lib.rs:1826–1837  ·  view source on GitHub ↗
(timeout: u64, proxy: &str)

Source from the content-addressed store, hash-verified

1824}
1825
1826pub fn create_http_client(timeout: u64, proxy: &str) -> Result<Client, Error> {
1827 // Ensure the ring provider is installed. Returns Err if already set, which
1828 // is fine — we just need it present before ClientBuilder::build() runs.
1829 let _ = rustls::crypto::ring::default_provider().install_default();
1830 let mut client_builder = Client::builder()
1831 .danger_accept_invalid_certs(true)
1832 .timeout(Duration::from_secs(timeout));
1833 if !proxy.is_empty() {
1834 client_builder = client_builder.proxy(Proxy::all(proxy)?);
1835 }
1836 Ok(client_builder.build().unwrap_or_default())
1837}
1838
1839#[cfg(test)]
1840mod tests {

Callers 11

new_with_nameMethod · 0.85
newMethod · 0.85
newMethod · 0.85
newMethod · 0.85
update_http_clientMethod · 0.85
newMethod · 0.85
ensure_jreFunction · 0.85
request_latest_jre_assetFunction · 0.85
newMethod · 0.85
newMethod · 0.85
newMethod · 0.85

Calls 3

is_emptyMethod · 0.80
proxyMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected