From 99566bb997b1c443b8f4e0ee7c214778b6010fb2 Mon Sep 17 00:00:00 2001 From: "ilblackdragon@gmail.com" Date: Sat, 21 Mar 2026 15:26:50 -0700 Subject: [PATCH] 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) --- src/config/mod.rs | 3 +-- src/llm/gemini_oauth.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 4d94ae48..68b23ab2 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -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; diff --git a/src/llm/gemini_oauth.rs b/src/llm/gemini_oauth.rs index 50f0179c..92066787 100644 --- a/src/llm/gemini_oauth.rs +++ b/src/llm/gemini_oauth.rs @@ -89,7 +89,7 @@ fn default_safety_settings() -> Vec { /// 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 { 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 { }; // Manual split: a comma is a separator only when followed (after optional - // whitespace) by `:` where header-name is `[A-Za-z0-9\-]+`. + // whitespace) by `:` where header-name is `[A-Za-z0-9_-]+`. let bytes = env_val.as_bytes(); let mut start = 0; let mut i = 0;