mirror of
https://github.com/alibaba/higress.git
synced 2026-03-19 17:57:31 +08:00
Fix the issue where AI route fallback does not work when using Bedrock. (#2653)
This commit is contained in:
@@ -59,18 +59,10 @@ func OverwriteRequestPath(path string) error {
|
||||
}
|
||||
|
||||
func OverwriteRequestAuthorization(credential string) error {
|
||||
if exist, _ := proxywasm.GetHttpRequestHeader(HeaderOriginalAuth); exist == "" {
|
||||
if originAuth, err := proxywasm.GetHttpRequestHeader(HeaderAuthorization); err == nil {
|
||||
_ = proxywasm.AddHttpRequestHeader(HeaderOriginalPath, originAuth)
|
||||
}
|
||||
}
|
||||
return proxywasm.ReplaceHttpRequestHeader(HeaderAuthorization, credential)
|
||||
}
|
||||
|
||||
func OverwriteRequestHostHeader(headers http.Header, host string) {
|
||||
if originHost, err := proxywasm.GetHttpRequestHeader(HeaderAuthority); err == nil {
|
||||
headers.Set(HeaderOriginalHost, originHost)
|
||||
}
|
||||
headers.Set(HeaderAuthority, host)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user