diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index abf95ff45a07fc9ea06bb97459a63d0cb2beb84f..68d3776e1c8dd410fa86c4f5c3fadb86097c4599 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -273,7 +273,7 @@ impl AutoUpdater { telemetry, })?); - let mut response = client.post_json(&release.url, request_body, true).await?; + let mut response = client.get(&release.url, request_body, true).await?; smol::io::copy(response.body_mut(), &mut dmg_file).await?; log::info!("downloaded update. path:{:?}", dmg_path); diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index 5dfb6595d1567e26f59cc69ea57892b7d826c896..7151dcd7bb0606efc59a5dec68669a4d7273d651 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -270,7 +270,7 @@ impl Telemetry { }])?; this.http_client - .post_json(MIXPANEL_ENGAGE_URL, json_bytes.into(), false) + .post_json(MIXPANEL_ENGAGE_URL, json_bytes.into()) .await?; anyhow::Ok(()) } @@ -404,7 +404,7 @@ impl Telemetry { json_bytes.clear(); serde_json::to_writer(&mut json_bytes, &events)?; this.http_client - .post_json(MIXPANEL_EVENTS_URL, json_bytes.into(), false) + .post_json(MIXPANEL_EVENTS_URL, json_bytes.into()) .await?; anyhow::Ok(()) } @@ -454,7 +454,7 @@ impl Telemetry { } this.http_client - .post_json(CLICKHOUSE_EVENTS_URL.as_str(), json_bytes.into(), false) + .post_json(CLICKHOUSE_EVENTS_URL.as_str(), json_bytes.into()) .await?; anyhow::Ok(()) } diff --git a/crates/util/src/http.rs b/crates/util/src/http.rs index e7f39552b0f832d0734dfaffce39775f262ca8ac..e29768a53e891e165dd859fd27be5325f35cdfa5 100644 --- a/crates/util/src/http.rs +++ b/crates/util/src/http.rs @@ -40,14 +40,8 @@ pub trait HttpClient: Send + Sync { &'a self, uri: &str, body: AsyncBody, - follow_redirects: bool, ) -> BoxFuture<'a, Result, Error>> { let request = isahc::Request::builder() - .redirect_policy(if follow_redirects { - RedirectPolicy::Follow - } else { - RedirectPolicy::None - }) .method(Method::POST) .uri(uri) .header("Content-Type", "application/json")