Replace isahc with async ureq (#18414)

REplace isahc with ureq everywhere gpui is used.

This should allow us to make http requests without libssl; and avoid a
long-tail of panics caused by ishac.

Release Notes:

- (potentially breaking change) updated our http client

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin
2024-10-02 12:30:48 -07:00
committed by GitHub
co-authored by Mikayla
parent f809787275
commit 3a5deb5c6f
33 changed files with 1068 additions and 401 deletions
+4 -6
View File
@@ -24,9 +24,9 @@ use gpui::{
UpdateGlobal as _, VisualContext,
};
use http_client::{read_proxy_from_env, Uri};
use isahc_http_client::IsahcHttpClient;
use language::LanguageRegistry;
use log::LevelFilter;
use ureq_client::UreqClient;
use assets::Assets;
use node_runtime::{NodeBinaryOptions, NodeRuntime};
@@ -334,9 +334,7 @@ fn main() {
log::info!("========== starting zed ==========");
let app = App::new()
.with_assets(Assets)
.with_http_client(IsahcHttpClient::new(None, None));
let app = App::new().with_assets(Assets);
let system_id = app.background_executor().block(system_id()).ok();
let installation_id = app.background_executor().block(installation_id()).ok();
@@ -470,8 +468,8 @@ fn main() {
.ok()
})
.or_else(read_proxy_from_env);
let http = IsahcHttpClient::new(proxy_url, Some(user_agent));
cx.set_http_client(http);
let http = UreqClient::new(proxy_url, user_agent, cx.background_executor().clone());
cx.set_http_client(Arc::new(http));
<dyn Fs>::set_global(fs.clone(), cx);