diff options
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 { |