mirror of
https://github.com/openai/codex.git
synced 2026-12-06 01:10:58 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user