fix(updater): fix typo, keep client instance

This commit is contained in:
Lucas Nogueira
2022-03-22 11:27:20 -03:00
parent 11cca918d9
commit b8ea013fd8
2 changed files with 8 additions and 10 deletions

View File

@@ -459,16 +459,14 @@ impl<R: Runtime> Update<R> {
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() {

View File

@@ -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")]