Revert http client changes (#18892)

These proved to be too unstable. Will restore these changes once the issues have been fixed.

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2024-10-09 01:07:18 -07:00 committed by GitHub
parent e351148152
commit 5d5c4b6677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 386 additions and 1125 deletions

View file

@ -18,9 +18,9 @@ clap = { workspace = true, features = ["derive"] }
env_logger.workspace = true
extension = { workspace = true, features = ["no-webrtc"] }
fs.workspace = true
isahc_http_client.workspace = true
language.workspace = true
log.workspace = true
reqwest_client.workspace = true
rpc.workspace = true
serde.workspace = true
serde_json.workspace = true

View file

@ -13,8 +13,8 @@ use extension::{
extension_builder::{CompileExtensionOptions, ExtensionBuilder},
ExtensionManifest,
};
use isahc_http_client::IsahcHttpClient;
use language::LanguageConfig;
use reqwest_client::ReqwestClient;
use theme::ThemeRegistry;
use tree_sitter::{Language, Query, WasmStore};
@ -66,7 +66,12 @@ async fn main() -> Result<()> {
std::env::consts::OS,
std::env::consts::ARCH
);
let http_client = Arc::new(ReqwestClient::user_agent(&user_agent)?);
let http_client = Arc::new(
IsahcHttpClient::builder()
.default_header("User-Agent", user_agent)
.build()
.map(IsahcHttpClient::from)?,
);
let builder = ExtensionBuilder::new(http_client, scratch_dir);
builder