feat: 状态码复写

This commit is contained in:
CaIon
2024-04-20 21:05:23 +08:00
parent b8fb351fd8
commit 6b71db7ce2
5 changed files with 70 additions and 1 deletions

View File

@@ -177,6 +177,7 @@ func SetupContextForSelectedChannel(c *gin.Context, channel *model.Channel, mode
}
c.Set("auto_ban", ban)
c.Set("model_mapping", channel.GetModelMapping())
c.Set("status_code_mapping", channel.GetStatusCodeMapping())
c.Request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", channel.Key))
c.Set("base_url", channel.GetBaseURL())
// TODO: api_version统一