support keep original auth header (#1151)

This commit is contained in:
澄潭
2024-07-24 19:31:38 +08:00
committed by GitHub
parent 2a588c99c7
commit 10569f49ae
14 changed files with 29 additions and 19 deletions

View File

@@ -43,7 +43,7 @@ func (m *yiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName,
}
_ = util.OverwriteRequestPath(yiChatCompletionPath)
_ = util.OverwriteRequestHost(yiDomain)
_ = proxywasm.ReplaceHttpRequestHeader("Authorization", "Bearer "+m.config.GetRandomToken())
_ = util.OverwriteRequestAuthorization("Bearer " + m.config.GetRandomToken())
if m.contextCache == nil {
ctx.DontReadRequestBody()