codex: address PR review feedback (#28582)

This commit is contained in:
Steven Lee
2026-06-23 07:28:54 +00:00
parent 7db1786573
commit e750db2ccb
16 changed files with 199 additions and 13 deletions
@@ -55,6 +55,18 @@ pub fn with_chatgpt_cloudflare_cookie_store(
builder.cookie_provider(Arc::clone(&SHARED_CHATGPT_CLOUDFLARE_COOKIE_STORE))
}
/// Returns the Cloudflare infrastructure cookies that the shared Codex cookie store would attach
/// to `url`.
///
/// Use this only when a caller must construct an explicit `Cookie` header. Reqwest does not add
/// cookie-provider values when that header is already present.
pub fn chatgpt_cloudflare_cookie_header(url: &str) -> Option<Vec<u8>> {
let url = reqwest::Url::parse(url).ok()?;
SHARED_CHATGPT_CLOUDFLARE_COOKIE_STORE
.cookies(&url)
.map(|value| value.as_bytes().to_vec())
}
fn is_chatgpt_cookie_url(url: &reqwest::Url) -> bool {
match url.scheme() {
"https" => {}
+1
View File
@@ -10,6 +10,7 @@ mod sse;
mod telemetry;
mod transport;
pub use crate::chatgpt_cloudflare_cookies::chatgpt_cloudflare_cookie_header;
pub use crate::chatgpt_cloudflare_cookies::with_chatgpt_cloudflare_cookie_store;
pub use crate::chatgpt_hosts::is_allowed_chatgpt_host;
pub use crate::custom_ca::BuildCustomCaTransportError;