feat: support custom http header

This commit is contained in:
ckt1031
2023-07-19 21:25:34 +08:00
parent cf564f36fa
commit 66e02a4bcf
6 changed files with 79 additions and 1 deletions

View File

@@ -105,6 +105,7 @@ func Distribute() func(c *gin.Context) {
c.Set("channel_id", channel.Id)
c.Set("channel_name", channel.Name)
c.Set("model_mapping", channel.ModelMapping)
c.Set("custom_http_headers", channel.CustomHttpHeaders)
c.Set("enable_ip_randomization", channel.EnableIpRandomization)
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
c.Set("base_url", channel.BaseURL)