mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-03 14:36:44 +08:00
Previously, check_claude_stream always added the x-api-key header, ignoring the provider's auth_mode setting. This caused health check failures for proxy services that only support Bearer authentication. Now the function respects the auth.strategy field: - AuthStrategy::Anthropic: Authorization Bearer + x-api-key - AuthStrategy::ClaudeAuth: Authorization Bearer only - AuthStrategy::Bearer: Authorization Bearer only This aligns with the behavior of ClaudeAdapter::add_auth_headers and fixes health checks for proxy providers with auth_mode="bearer_only". Changes: - Modified check_claude_stream to conditionally add x-api-key header - Added AuthStrategy import - Added test_auth_strategy_imports unit test Tests: All passing (7/7 for stream_check module) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>