mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-26 23:50:17 +00:00
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:
+1
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user