feat: support ip randomize in http header

This commit is contained in:
ckt1031
2023-07-14 21:30:13 +08:00
parent 164df4e708
commit 4043fccedb
6 changed files with 64 additions and 2 deletions

View File

@@ -100,6 +100,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("enable_ip_randomization", channel.EnableIpRandomization)
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
c.Set("base_url", channel.BaseURL)
if channel.Type == common.ChannelTypeAzure {