mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-18 23:07:27 +02:00
fix(updater): warn when the update download URL is not https (#3694)
* fix(updater): warn when the update download URL is not https `validate_endpoints` enforces `https` for the endpoints, but not for the `url` of the manifest, so the artifact can be downloaded in plaintext. Enforcing it would break existing releases (left for v3); `Update::download` now logs a warning instead, unless `dangerousInsecureTransportProtocol` is enabled. plugins/updater/src/updater.rs * Apply suggestion from @lucasfernog
This commit is contained in:
1 parent
4b1ba07943
commit
d057ec4736
2 files changed
+18
No files matched your search
@@ -821,6 +821,18 @@ impl Update {
|
||||
mut on_chunk: C,
|
||||
on_download_finish: D,
|
||||
) -> Result<Vec<u8>> {
|
||||
// not enforced (unlike for the endpoints) as that would break existing releases, but the
|
||||
// artifact then travels in plaintext: only its signature protects it
|
||||
// TODO(v3): enforce it
|
||||
if self.download_url.scheme() != "https"
|
||||
&& !self.context.config.dangerous_insecure_transport_protocol
|
||||
{
|
||||
log::warn!(
|
||||
"the update download URL {} does not use the `https` protocol",
|
||||
self.download_url
|
||||
);
|
||||
}
|
||||
|
||||
// set our headers
|
||||
let mut headers = self.headers.clone();
|
||||
if !headers.contains_key(ACCEPT) {
|
||||
|
||||
Reference in new issue
Block a user