chore(updater): non https endpoint warning (#1311)

closes #1308
pull/1312/head
Amr Bashir 1 year ago committed by GitHub
parent 989bee8192
commit c8b78034a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -118,9 +118,13 @@ impl<'de> Deserialize<'de> for UpdaterEndpoint {
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
let url = Url::deserialize(deserializer)?; let url = Url::deserialize(deserializer)?;
#[cfg(all(not(debug_assertions), not(feature = "schema")))] #[cfg(not(feature = "schema"))]
{ {
if url.scheme() != "https" { if url.scheme() != "https" {
#[cfg(debug_assertions)]
eprintln!("[\x1b[33mWARNING\x1b[0m] The configured updater endpoint doesn't use `https` protocol. This is allowed in development but will fail in release builds.");
#[cfg(not(debug_assertions))]
return Err(serde::de::Error::custom( return Err(serde::de::Error::custom(
"The configured updater endpoint must use the `https` protocol.", "The configured updater endpoint must use the `https` protocol.",
)); ));

Loading…
Cancel
Save