mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
fix stats url handling
This commit is contained in:
parent
dd45ab6ad7
commit
d83bcf3133
3 changed files with 5 additions and 7 deletions
|
@ -675,7 +675,7 @@ mod test {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_string();
|
.to_string();
|
||||||
assert!(
|
assert!(
|
||||||
long_help.ends_with(binstalk::QUICK_INSTALL_STATS_URL),
|
long_help.ends_with(binstalk::QUICKINSTALL_STATS_URL),
|
||||||
"{}",
|
"{}",
|
||||||
long_help
|
long_help
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,7 +16,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download";
|
const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download";
|
||||||
pub const QUICK_INSTALL_STATS_URL: &str =
|
pub const QUICKINSTALL_STATS_URL: &str =
|
||||||
"https://cargo-quickinstall-stats-server.fly.dev/record-install";
|
"https://cargo-quickinstall-stats-server.fly.dev/record-install";
|
||||||
|
|
||||||
const QUICKINSTALL_SIGN_KEY: Cow<'static, str> =
|
const QUICKINSTALL_SIGN_KEY: Cow<'static, str> =
|
||||||
|
@ -63,7 +63,6 @@ pub struct QuickInstall {
|
||||||
package: String,
|
package: String,
|
||||||
package_url: Url,
|
package_url: Url,
|
||||||
signature_url: Url,
|
signature_url: Url,
|
||||||
stats_url: Url,
|
|
||||||
signature_policy: SignaturePolicy,
|
signature_policy: SignaturePolicy,
|
||||||
|
|
||||||
target_data: Arc<TargetDataErased>,
|
target_data: Arc<TargetDataErased>,
|
||||||
|
@ -179,8 +178,6 @@ impl super::Fetcher for QuickInstall {
|
||||||
.expect("package_url is pre-generated and should never be invalid url"),
|
.expect("package_url is pre-generated and should never be invalid url"),
|
||||||
signature_url: Url::parse(&format!("{url}.sig"))
|
signature_url: Url::parse(&format!("{url}.sig"))
|
||||||
.expect("signature_url is pre-generated and should never be invalid url"),
|
.expect("signature_url is pre-generated and should never be invalid url"),
|
||||||
stats_url: Url::parse("{QUICK_INSTALL_STATS_URL}")
|
|
||||||
.expect("stats_url is pre-generated and should never be invalid url"),
|
|
||||||
package,
|
package,
|
||||||
signature_policy,
|
signature_policy,
|
||||||
|
|
||||||
|
@ -321,7 +318,8 @@ impl QuickInstall {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut url = self.stats_url.clone();
|
let mut url = Url::parse(QUICKINSTALL_STATS_URL)
|
||||||
|
.expect("stats_url is pre-generated and should never be invalid url");
|
||||||
url.query_pairs_mut()
|
url.query_pairs_mut()
|
||||||
.append_pair("crate", &self.data.name)
|
.append_pair("crate", &self.data.name)
|
||||||
.append_pair("version", &self.data.version)
|
.append_pair("version", &self.data.version)
|
||||||
|
|
|
@ -10,4 +10,4 @@ pub use binstalk_registry as registry;
|
||||||
pub use binstalk_types as manifests;
|
pub use binstalk_types as manifests;
|
||||||
pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET};
|
pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET};
|
||||||
|
|
||||||
pub use fetchers::QUICK_INSTALL_STATS_URL;
|
pub use fetchers::QUICKINSTALL_STATS_URL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue