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

Function create_http_client

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

Source from the content-addressed store, hash-verified

1842}
1843
1844pub fn create_http_client(timeout: u64, proxy: &str) -> Result<Client, Error> {
1845 // Ensure the ring provider is installed. Returns Err if already set, which
1846 // is fine — we just need it present before ClientBuilder::build() runs.
1847 let _ = rustls::crypto::ring::default_provider().install_default();
1848 let mut client_builder = Client::builder()
1849 .danger_accept_invalid_certs(true)
1850 .timeout(Duration::from_secs(timeout));
1851 if !proxy.is_empty() {
1852 client_builder = client_builder.proxy(Proxy::all(proxy)?);
1853 }
1854 Ok(client_builder.build().unwrap_or_default())
1855}
1856
1857#[cfg(test)]
1858mod 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