From b79d8d7fec31a2111f664a20a2f85d0a7b75874f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:36:18 +1200 Subject: [PATCH] Warn on non-HTTPS url --- src/fetchers/gh_crate_meta.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index c0f4035a..c8b4e60d 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -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 { 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 }