Set user-agent (#2230)

Use the same well-defined value in all cases when sending user-agent
header
This commit is contained in:
pakrym-oai
2025-08-12 09:40:04 -07:00
committed by GitHub
parent e8670ad840
commit cb78f2333e
7 changed files with 59 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
use codex_core::config::Config;
use codex_core::user_agent::get_codex_user_agent;
use crate::chatgpt_token::get_chatgpt_token_data;
use crate::chatgpt_token::init_chatgpt_token_from_auth;
@@ -30,7 +31,7 @@ pub(crate) async fn chatgpt_get_request<T: DeserializeOwned>(
.bearer_auth(&token.access_token)
.header("chatgpt-account-id", account_id?)
.header("Content-Type", "application/json")
.header("User-Agent", "codex-cli")
.header("User-Agent", get_codex_user_agent(None))
.send()
.await
.context("Failed to send request")?;