Remove unused HTTP client APIs (#63669)

## What changed

- Remove the deprecated `build_with_transport_default_proxy` method and
  inline its shared helper into the remaining caller, `build_direct`.
- Remove the unused `has_chatgpt_cookies` accessor, `with_raw_body`
  setter, and `with_chatgpt_cloudflare_cookies_without_redirects` pool
  constructor.

GitOrigin-RevId: 9dd19b7a28b1aac6f196968b53160ffbc7443b8a
This commit is contained in:
jif
2026-11-24 16:15:13 +00:00
committed by copyberry
parent 1a6c8514cc
commit 6b7a16fe76
4 changed files with 5 additions and 53 deletions
+5 -28
View File
@@ -264,22 +264,6 @@ impl HttpClientBuilder {
self
}
/// Builds a client using the transport's default proxy behavior.
///
/// # Legacy compatibility only
///
/// This bypasses [`HttpClientFactory`] and therefore does not honor its configured outbound
/// proxy policy. New product traffic must use [`Self::build_respecting_outbound_proxy_policy`]
/// or [`HttpClientFactory::build_client`].
#[deprecated(
note = "legacy compatibility only; use HttpClientFactory::build_client or build_respecting_outbound_proxy_policy"
)]
pub fn build_with_transport_default_proxy(
self,
) -> Result<HttpClient, BuildCustomCaTransportError> {
self.build_with_proxy_routing(ProxyRouting::TransportDefault)
}
/// Builds a client that connects directly without using a proxy.
///
/// # Exceptional use only
@@ -289,8 +273,11 @@ impl HttpClientBuilder {
/// sandbox traffic whose egress routing is handled separately. Ordinary outbound product
/// traffic must use [`Self::build_respecting_outbound_proxy_policy`] or
/// [`HttpClientFactory::build_client`].
pub fn build_direct(self) -> Result<HttpClient, BuildCustomCaTransportError> {
self.build_with_proxy_routing(ProxyRouting::Direct)
pub fn build_direct(mut self) -> Result<HttpClient, BuildCustomCaTransportError> {
let request_logging = self.request_logging;
let default_headers = self.default_headers.take().unwrap_or_default();
build_reqwest_client_with_custom_ca(self.reqwest_builder(ProxyRouting::Direct))
.map(|inner| HttpClient::from_parts(inner, request_logging, default_headers))
}
/// Builds a transport-default client while preserving the legacy custom-CA fallback.
@@ -328,16 +315,6 @@ impl HttpClientBuilder {
}
}
fn build_with_proxy_routing(
mut self,
proxy_routing: ProxyRouting,
) -> Result<HttpClient, BuildCustomCaTransportError> {
let request_logging = self.request_logging;
let default_headers = self.default_headers.take().unwrap_or_default();
build_reqwest_client_with_custom_ca(self.reqwest_builder(proxy_routing))
.map(|inner| HttpClient::from_parts(inner, request_logging, default_headers))
}
pub(crate) fn build_with_custom_ca_fallback(
self,
proxy_routing: ProxyRouting,