mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 15:30:03 +00:00
Refactor: Extract new_reqwest_client(_builder)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
a747edffd5
commit
8e92db3dc6
2 changed files with 17 additions and 5 deletions
|
@ -7,7 +7,9 @@ use tokio::task::JoinHandle;
|
|||
use url::Url;
|
||||
|
||||
use super::Data;
|
||||
use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt};
|
||||
use crate::{
|
||||
download_and_extract, new_reqwest_client_builder, remote_exists, BinstallError, PkgFmt,
|
||||
};
|
||||
|
||||
const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download";
|
||||
const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate";
|
||||
|
@ -89,7 +91,7 @@ impl QuickInstall {
|
|||
let url = Url::parse(&stats_url)?;
|
||||
debug!("Sending installation report to quickinstall ({url})");
|
||||
|
||||
reqwest::Client::builder()
|
||||
new_reqwest_client_builder()
|
||||
.user_agent(USER_AGENT)
|
||||
.build()?
|
||||
.request(Method::HEAD, url.clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue