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
24 changed files with 114 additions and 106 deletions
-1
View File
@@ -57,7 +57,6 @@ http_client.workspace = true
image_viewer.workspace = true
inline_completion_button.workspace = true
install_cli.workspace = true
isahc.workspace = true
isahc_http_client.workspace = true
journal.workspace = true
language.workspace = true
+2 -3
View File
@@ -4,8 +4,7 @@ use chrono::Utc;
use client::telemetry;
use db::kvp::KEY_VALUE_STORE;
use gpui::{AppContext, SemanticVersion};
use http_client::Method;
use isahc::config::Configurable;
use http_client::{HttpRequestExt, Method};
use http_client::{self, HttpClient, HttpClientWithUrl};
use paths::{crashes_dir, crashes_retired_dir};
@@ -491,7 +490,7 @@ async fn upload_previous_crashes(
.context("error reading crash file")?;
let mut request = http_client::Request::post(&crash_report_url.to_string())
.redirect_policy(isahc::config::RedirectPolicy::Follow)
.follow_redirects(http_client::RedirectPolicy::FollowAll)
.header("Content-Type", "text/plain");
if let Some((panicked_on, payload)) = most_recent_panic.as_ref() {