feat(claude): 实现智能请求头管理系统

核心功能:
- 支持渠道级透传设置 (修复 killcode 客户端兼容性)
- 智能客户端检测 (Claude Code、killcode、其他客户端)
- 动态请求头策略 (透传 vs 伪装)

客户端处理策略:
- Claude Code (claude-cli/*): 完全透传原始请求头
- killcode (B2/JS + Stainless SDK): 完全透传原始请求头
- 其他客户端: 伪装成 killcode 格式绕过上游限制

技术改进:
- 防止显示 Go-http-client/2.0 User-Agent
- 保留重要认证头部 (anthropic-version, anthropic-beta)
- 兼容全局透传和渠道透传设置

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
huangzhenpc
2025-08-26 16:24:51 +08:00
parent a8b11912df
commit 38e17d621d
2 changed files with 68 additions and 10 deletions

2
go.mod
View File

@@ -1,7 +1,7 @@
module one-api
// +heroku goVersion go1.18
go 1.23.4
go 1.23
require (
github.com/Calcium-Ion/go-epay v0.0.4