feat: sync deployed v1.0.0-rc.38-custom.42

Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
cneicy committed 2026-09-26 04:49:11 +08:00
1 parent aa6c3f50f4
commit ceddfd3d6b
828 files changed
+122253 -13702

No files matched your search

+27
View File
@@ -23,6 +23,33 @@ import (
"github.com/stretchr/testify/require"
)
func TestGetChannelDefaultBaseURLsUsesBuiltInDefaults(t *testing.T) {
originalBaseURLs := constant.ChannelBaseURLs
constant.ChannelBaseURLs = append([]string(nil), originalBaseURLs...)
constant.ChannelBaseURLs[constant.ChannelTypeDeepSeek] = "https://deepseek.server.example"
t.Cleanup(func() {
constant.ChannelBaseURLs = originalBaseURLs
})
recorder := httptest.NewRecorder()
c, _ := gin.CreateTestContext(recorder)
c.Request = httptest.NewRequest(http.MethodGet, "/api/channel/default_base_urls", nil)
GetChannelDefaultBaseURLs(c)
require.Equal(t, http.StatusOK, recorder.Code)
var response struct {
Success bool `json:"success"`
Data map[int]string `json:"data"`
}
require.NoError(t, common.Unmarshal(recorder.Body.Bytes(), &response))
require.True(t, response.Success)
assert.Equal(t, "https://deepseek.server.example", response.Data[constant.ChannelTypeDeepSeek])
assert.Equal(t, "https://api.openai.com", response.Data[constant.ChannelTypeOpenAI])
assert.NotContains(t, response.Data, constant.ChannelTypeAzure)
assert.NotContains(t, response.Data, constant.ChannelTypeNewAPI)
assert.NotContains(t, response.Data, constant.ChannelTypeTaskPlugin)
}
func TestValidateChannelProxy(t *testing.T) {
tests := []struct {
name string