feat: sync remaining channel and relay updates
This commit is contained in:
@@ -178,6 +178,8 @@ func buildFetchModelsHeaders(channel *model.Channel, key string) (http.Header, e
|
||||
switch channel.Type {
|
||||
case constant.ChannelTypeAnthropic:
|
||||
headers = GetClaudeAuthHeader(key)
|
||||
case constant.ChannelTypeClaudeCodeCLIProxy:
|
||||
headers = GetClaudeCodeAuthHeader(key)
|
||||
default:
|
||||
headers = GetAuthHeader(key)
|
||||
}
|
||||
@@ -469,6 +471,12 @@ func validateChannel(channel *model.Channel, isAdd bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
if (channel.Type == constant.ChannelTypeCodexCLIProxy ||
|
||||
channel.Type == constant.ChannelTypeClaudeCodeCLIProxy ||
|
||||
channel.Type == constant.ChannelTypeGeminiCLIProxy) && strings.TrimSpace(channel.GetBaseURL()) == "" {
|
||||
return fmt.Errorf("proxy-compatible channel requires base_url")
|
||||
}
|
||||
|
||||
// Codex OAuth key validation (optional, only when JSON object is provided)
|
||||
if channel.Type == constant.ChannelTypeCodex {
|
||||
trimmedKey := strings.TrimSpace(channel.Key)
|
||||
|
||||
Reference in New Issue
Block a user