fix(updater): replace url vars in query params (#756)

This commit is contained in:
Fabian-Lars
2023-11-22 16:08:24 +01:00
committed by GitHub
parent 445c1e6cb6
commit 0864c54147
2 changed files with 10 additions and 1 deletions
@@ -0,0 +1,5 @@
---
"updater": "patch"
---
The plugin now correctly replaces `arch`, `current_version` and `target` in query params again.
+5 -1
View File
@@ -258,13 +258,17 @@ impl Updater {
// the URL will be generated dynamically
let url: Url = url
.to_string()
// url::Url automatically url-encodes the string
// url::Url automatically url-encodes the path components
.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)
// but not query parameters
.replace("{{current_version}}", &self.current_version.to_string())
.replace("{{target}}", &self.target)
.replace("{{arch}}", self.arch)
.parse()?;
let mut request = Client::new().get(url).headers(headers.clone());