mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
undo default client diff
This commit is contained in:
@@ -288,7 +288,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_get_codex_user_agent() {
|
||||
let user_agent = get_codex_user_agent();
|
||||
assert!(user_agent.starts_with(&format!("{}/", originator().value)));
|
||||
assert!(user_agent.starts_with("codex_cli_rs/"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -329,10 +329,7 @@ mod tests {
|
||||
let originator_header = headers
|
||||
.get("originator")
|
||||
.expect("originator header missing");
|
||||
assert_eq!(
|
||||
originator_header.to_str().unwrap(),
|
||||
originator().value.as_str()
|
||||
);
|
||||
assert_eq!(originator_header.to_str().unwrap(), "codex_cli_rs");
|
||||
|
||||
// User-Agent matches the computed Codex UA for that originator
|
||||
let expected_ua = get_codex_user_agent();
|
||||
@@ -368,11 +365,9 @@ mod tests {
|
||||
#[cfg(target_os = "macos")]
|
||||
fn test_macos() {
|
||||
use regex_lite::Regex;
|
||||
let originator = originator().value.clone();
|
||||
let user_agent = get_codex_user_agent();
|
||||
let re = Regex::new(
|
||||
format!(r"^{originator}/\d+\.\d+\.\d+ \(Mac OS \d+\.\d+\.\d+; (x86_64|arm64)\) (\S+)$")
|
||||
.as_str(),
|
||||
r"^codex_cli_rs/\d+\.\d+\.\d+ \(Mac OS \d+\.\d+\.\d+; (x86_64|arm64)\) (\S+)$",
|
||||
)
|
||||
.unwrap();
|
||||
assert!(re.is_match(&user_agent));
|
||||
|
||||
Reference in New Issue
Block a user