MCPcopy Create free account
hub / github.com/ddd/gpb / create_client

Function create_client

src/utils/utils.rs:28–45  ·  view source on GitHub ↗
(subnet: Option<&str>, user_agent: &str)

Source from the content-addressed store, hash-verified

26}
27
28pub fn create_client(subnet: Option<&str>, user_agent: &str) -> Client {
29 if let Some(subnet) = subnet {
30 let ip = get_rand_ipv6(subnet);
31
32 Client::builder()
33 .redirect(redirect::Policy::none())
34 .danger_accept_invalid_certs(true)
35 .user_agent(user_agent)
36 .local_address(Some(ip))
37 .build().unwrap()
38 } else {
39 Client::builder()
40 .redirect(redirect::Policy::none())
41 .danger_accept_invalid_certs(true)
42 .user_agent(user_agent)
43 .build().unwrap()
44 }
45}

Callers 8

check_blacklistFunction · 0.85
test_lookup_valid_hitFunction · 0.85
test_lookup_invalid_hitFunction · 0.85
test_lookup_valid_hitFunction · 0.85
test_lookup_invalid_hitFunction · 0.85
fetch_auth_credentialsFunction · 0.85
workerFunction · 0.85
csv_workerFunction · 0.85

Calls 1

get_rand_ipv6Function · 0.85

Tested by 4

test_lookup_valid_hitFunction · 0.68
test_lookup_invalid_hitFunction · 0.68
test_lookup_valid_hitFunction · 0.68
test_lookup_invalid_hitFunction · 0.68