mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-06 22:01:44 +08:00
The issue-1888 branch only stripped hop-by-hop headers for Codex requests hitting a narrow set of OpenRouter endpoints. That left Claude-compatible paths and custom-domain OpenRouter relays forwarding Connection-derived headers. The forwarder now treats any OpenRouter provider as eligible, keyed by providerType with openrouter.ai as a backward-compatible fallback, and keeps the helper coverage focused on both static and dynamic header names. Constraint: Existing issue-1888 logic already depended on forwarder-side header rewriting Rejected: Endpoint-specific allowlist | still misses Claude-compatible and custom-domain OpenRouter routes Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep providerType-based OpenRouter matching ahead of hostname heuristics when this path evolves Tested: cargo test --manifest-path src-tauri/Cargo.toml forwarder::tests Tested: cargo clippy --manifest-path src-tauri/Cargo.toml --lib -- -W clippy::too_many_arguments Not-tested: Live request against a custom-domain OpenRouter relay