Stop leaking isahc assumption (#18408)

Users of our http_client crate knew they were interacting with isahc as
they set its extensions on the request. This change adds our own
equivalents for their APIs in preparation for changing the default http
client.

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-09-26 14:01:05 -06:00 committed by GitHub
parent c1a039a5d7
commit e28496d4e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 114 additions and 106 deletions

View file

@ -23,7 +23,6 @@ editor.workspace = true
futures.workspace = true
gpui.workspace = true
human_bytes = "0.4.1"
isahc.workspace = true
http_client.workspace = true
language.workspace = true
log.workspace = true

View file

@ -11,7 +11,6 @@ use gpui::{
PromptLevel, Render, Task, View, ViewContext,
};
use http_client::HttpClient;
use isahc::Request;
use language::Buffer;
use project::Project;
use regex::Regex;
@ -299,7 +298,7 @@ impl FeedbackModal {
is_staff: is_staff.unwrap_or(false),
};
let json_bytes = serde_json::to_vec(&request)?;
let request = Request::post(feedback_endpoint)
let request = http_client::http::Request::post(feedback_endpoint)
.header("content-type", "application/json")
.body(json_bytes.into())?;
let mut response = http_client.send(request).await?;