diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-08-18 18:30:13 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-08-19 02:01:48 +0200 |
commit | 27f4aeb92469660fdd78a89a7b2902c08a23ca4a (patch) | |
tree | e2076aaf31f0708e5037f46d3750f93b0d637417 /cli/http_util.rs | |
parent | de1007fc6a2a6c2909732dcb87a5af6c1e370b09 (diff) |
Make Rc/Arc wrapper around State/GlobalState visible (#7104)
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r-- | cli/http_util.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs index 531339b5d..bf302f7b2 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -26,7 +26,7 @@ use url::Url; /// Create new instance of async reqwest::Client. This client supports /// proxies and doesn't follow redirects. -pub fn create_http_client(ca_file: Option<String>) -> Result<Client, ErrBox> { +pub fn create_http_client(ca_file: Option<&str>) -> Result<Client, ErrBox> { let mut headers = HeaderMap::new(); headers.insert( USER_AGENT, @@ -397,12 +397,12 @@ mod tests { let url = Url::parse("https://localhost:5545/cli/tests/fixture.json").unwrap(); - let client = create_http_client(Some(String::from( + let client = create_http_client(Some( test_util::root_path() .join("std/http/testdata/tls/RootCA.pem") .to_str() .unwrap(), - ))) + )) .unwrap(); let result = fetch_once(client, &url, None).await; if let Ok(FetchOnceResult::Code(body, headers)) = result { @@ -423,12 +423,12 @@ mod tests { "https://localhost:5545/cli/tests/053_import_compression/gziped", ) .unwrap(); - let client = create_http_client(Some(String::from( + let client = create_http_client(Some( test_util::root_path() .join("std/http/testdata/tls/RootCA.pem") .to_str() .unwrap(), - ))) + )) .unwrap(); let result = fetch_once(client, &url, None).await; if let Ok(FetchOnceResult::Code(body, headers)) = result { @@ -448,12 +448,12 @@ mod tests { async fn test_fetch_with_cafile_with_etag() { let _http_server_guard = test_util::http_server(); let url = Url::parse("https://localhost:5545/etag_script.ts").unwrap(); - let client = create_http_client(Some(String::from( + let client = create_http_client(Some( test_util::root_path() .join("std/http/testdata/tls/RootCA.pem") .to_str() .unwrap(), - ))) + )) .unwrap(); let result = fetch_once(client.clone(), &url, None).await; if let Ok(FetchOnceResult::Code(body, headers)) = result { @@ -482,12 +482,12 @@ mod tests { "https://localhost:5545/cli/tests/053_import_compression/brotli", ) .unwrap(); - let client = create_http_client(Some(String::from( + let client = create_http_client(Some( test_util::root_path() .join("std/http/testdata/tls/RootCA.pem") .to_str() .unwrap(), - ))) + )) .unwrap(); let result = fetch_once(client, &url, None).await; if let Ok(FetchOnceResult::Code(body, headers)) = result { |