mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
backend-client: route requests through HTTP client factory
This commit is contained in:
@@ -19,6 +19,7 @@ chrono = { workspace = true, features = ["serde"] }
|
||||
codex-api = { workspace = true }
|
||||
codex-backend-client = { workspace = true }
|
||||
codex-git-utils = { workspace = true }
|
||||
codex-http-client = { workspace = true }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
@@ -28,9 +28,12 @@ pub struct HttpClient {
|
||||
}
|
||||
|
||||
impl HttpClient {
|
||||
pub fn new(base_url: impl Into<String>) -> anyhow::Result<Self> {
|
||||
pub fn new(
|
||||
base_url: impl Into<String>,
|
||||
http_client_factory: codex_http_client::HttpClientFactory,
|
||||
) -> anyhow::Result<Self> {
|
||||
let base_url = base_url.into();
|
||||
let backend = backend::Client::new(base_url.clone())?;
|
||||
let backend = backend::Client::new(base_url.clone(), http_client_factory)?;
|
||||
Ok(Self { base_url, backend })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user