fix(gemini_oauth): align header parser doc with implementation [skip-regression-check]

Update parse_custom_headers doc comments to include underscore in the
header-name character class, matching the actual implementation.
Also fix formatting from merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
2026-03-21 15:26:50 -07:00
co-authored by Claude Opus 4.6
parent cbf96f25c9
commit 99566bb997
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -57,8 +57,7 @@ pub use self::wasm::WasmConfig;
pub use self::workspace::WorkspaceConfig;
pub use crate::llm::config::{
BedrockConfig, CacheRetention, GeminiOauthConfig, LlmConfig, NearAiConfig, OAUTH_PLACEHOLDER,
OpenAiCodexConfig,
RegistryProviderConfig,
OpenAiCodexConfig, RegistryProviderConfig,
};
pub use crate::llm::session::SessionConfig;
+2 -2
View File
@@ -89,7 +89,7 @@ fn default_safety_settings() -> Vec<serde_json::Value> {
/// Parse `GEMINI_CLI_CUSTOM_HEADERS` env var in format `key:value,key:value`.
/// Commas inside values are preserved — splits only on commas followed by a
/// valid HTTP header name pattern (ASCII alphanumeric/hyphen/underscore, then `:`).
/// valid HTTP header-name pattern (`[A-Za-z0-9_-]+:`).
fn parse_custom_headers() -> std::collections::HashMap<String, String> {
let mut headers = std::collections::HashMap::new();
let env_val = match std::env::var("GEMINI_CLI_CUSTOM_HEADERS") {
@@ -98,7 +98,7 @@ fn parse_custom_headers() -> std::collections::HashMap<String, String> {
};
// Manual split: a comma is a separator only when followed (after optional
// whitespace) by `<header-name>:` where header-name is `[A-Za-z0-9\-]+`.
// whitespace) by `<header-name>:` where header-name is `[A-Za-z0-9_-]+`.
let bytes = env_val.as_bytes();
let mut start = 0;
let mut i = 0;