|
@@ -15,6 +15,7 @@ use http::{
|
|
|
HeaderMap, StatusCode,
|
|
|
};
|
|
|
use minisign_verify::{PublicKey, Signature};
|
|
|
+use percent_encoding::{AsciiSet, CONTROLS};
|
|
|
use semver::Version;
|
|
|
use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize};
|
|
|
use tauri_utils::{platform::current_exe, Env};
|
|
@@ -374,8 +375,12 @@ impl<R: Runtime> UpdateBuilder<R> {
|
|
|
// https://releases.myapp.com/update/darwin/aarch64/1.0.0
|
|
|
// The main objective is if the update URL is defined via the Cargo.toml
|
|
|
// the URL will be generated dynamically
|
|
|
+ let version = self.current_version.to_string();
|
|
|
+ const CONTROLS_ADD: &AsciiSet = &CONTROLS.add(b'+');
|
|
|
+ let encoded_version = percent_encoding::percent_encode(version.as_bytes(), CONTROLS_ADD);
|
|
|
+
|
|
|
let fixed_link = url
|
|
|
- .replace("{{current_version}}", &self.current_version.to_string())
|
|
|
+ .replace("{{current_version}}", &encoded_version.to_string())
|
|
|
.replace("{{target}}", &target)
|
|
|
.replace("{{arch}}", arch);
|
|
|
|