fix(updater): Fix endpoint string replacements, fixes #655 (#662)

* fix(updater): Fix endpoint string replacements, fixes #655

* fmt
pull/260/merge
Fabian-Lars 2 years ago committed by GitHub
parent 8902fe9adf
commit 28ec084e56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
"updater": "patch"
---
The plugin now correctly replaces `arch`, `current_version` and `target` again.

@ -258,9 +258,13 @@ impl Updater {
// the URL will be generated dynamically
let url: Url = url
.to_string()
.replace("{{current_version}}", &self.current_version.to_string())
.replace("{{target}}", &self.target)
.replace("{{arch}}", self.arch)
// url::Url automatically url-encodes the string
.replace(
"%7B%7Bcurrent_version%7D%7D",
&self.current_version.to_string(),
)
.replace("%7B%7Btarget%7D%7D", &self.target)
.replace("%7B%7Barch%7D%7D", self.arch)
.parse()?;
let mut request = Client::new().get(url).headers(headers.clone());

Loading…
Cancel
Save