From b8ea013fd89f8179aff6cdbc7c19d7a126d8a0bc Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Tue, 22 Mar 2022 11:27:20 -0300 Subject: [PATCH] fix(updater): fix typo, keep client instance --- core/tauri/src/updater/core.rs | 16 +++++++--------- core/tauri/src/updater/error.rs | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/core/tauri/src/updater/core.rs b/core/tauri/src/updater/core.rs index c3201850c..fb5f086fc 100644 --- a/core/tauri/src/updater/core.rs +++ b/core/tauri/src/updater/core.rs @@ -459,16 +459,14 @@ impl Update { headers.insert("Accept".into(), "application/octet-stream".into()); headers.insert("User-Agent".into(), "tauri/updater".into()); + let client = ClientBuilder::new().build()?; // Create our request - let response = ClientBuilder::new() - .build()? - .send( - HttpRequestBuilder::new("GET", self.download_url.as_str())? - .headers(headers) - // wait 20sec for the firewall - .timeout(20), - ) - .await?; + let req = HttpRequestBuilder::new("GET", self.download_url.as_str())? + .headers(headers) + // wait 20sec for the firewall + .timeout(20); + + let response = client.send(req).await?; // make sure it's success if !response.status().is_success() { diff --git a/core/tauri/src/updater/error.rs b/core/tauri/src/updater/error.rs index f1c6d964f..320c407c8 100644 --- a/core/tauri/src/updater/error.rs +++ b/core/tauri/src/updater/error.rs @@ -42,7 +42,7 @@ pub enum Error { #[error("Unable to extract the new version: {0}")] Extract(String), /// Updater is not supported for current operating system or platform. - #[error("Unsuported operating system or platform")] + #[error("Unsupported operating system or platform")] UnsupportedPlatform, /// Public key found in `tauri.conf.json` but no signature announced remotely. #[error("Signature not available, skipping update")]