mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
Warn on non-HTTPS url
This commit is contained in:
parent
a1fa3a47e5
commit
b79d8d7fec
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::path::Path;
|
||||
|
||||
use log::{debug, info};
|
||||
use log::{debug, info, warn};
|
||||
use reqwest::Method;
|
||||
use serde::Serialize;
|
||||
use url::Url;
|
||||
|
@ -28,6 +28,11 @@ impl super::Fetcher for GhCrateMeta {
|
|||
|
||||
async fn check(&self) -> Result<bool, BinstallError> {
|
||||
let url = self.url()?;
|
||||
|
||||
if url.scheme() != "https" {
|
||||
warn!("URL is not HTTPS! This may become a hard error in the future, tell the upstream!");
|
||||
}
|
||||
|
||||
info!("Checking for package at: '{url}'");
|
||||
remote_exists(url.as_str(), Method::HEAD).await
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue