mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
fix(updater): validate endpoint scheme before printing warning (#1868)
regression from #1814
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"updater": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix configuration parser incorrectly warning about the endpoint scheme.
|
||||||
@@ -142,14 +142,13 @@ pub(crate) fn validate_endpoints(
|
|||||||
) -> crate::Result<()> {
|
) -> crate::Result<()> {
|
||||||
if !dangerous_insecure_transport_protocol {
|
if !dangerous_insecure_transport_protocol {
|
||||||
for url in endpoints {
|
for url in endpoints {
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
eprintln!("[\x1b[33mWARNING\x1b[0m] The updater endpoint \"{url}\" doesn't use `https` protocol. This is allowed in development but will fail in release builds.");
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
eprintln!("[\x1b[33mWARNING\x1b[0m] if this is a desired behavior, you can enable `dangerousInsecureTransportProtocol` in the plugin configuration");
|
|
||||||
|
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
if url.scheme() != "https" {
|
if url.scheme() != "https" {
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
{
|
||||||
|
eprintln!("[\x1b[33mWARNING\x1b[0m] The updater endpoint \"{url}\" doesn't use `https` protocol. This is allowed in development but will fail in release builds.");
|
||||||
|
eprintln!("[\x1b[33mWARNING\x1b[0m] if this is a desired behavior, you can enable `dangerousInsecureTransportProtocol` in the plugin configuration");
|
||||||
|
}
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
return Err(crate::Error::InsecureTransportProtocol);
|
return Err(crate::Error::InsecureTransportProtocol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user