-
Notifications
You must be signed in to change notification settings - Fork 527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Bypass the response body processing in ai-proxy if it is returned internally #1149
fix: Bypass the response body processing in ai-proxy if it is returned internally #1149
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1149 +/- ##
==========================================
+ Coverage 35.91% 36.11% +0.20%
==========================================
Files 69 69
Lines 11576 9464 -2112
==========================================
- Hits 4157 3418 -739
+ Misses 7104 5730 -1374
- Partials 315 316 +1 |
@@ -111,6 +111,12 @@ func onHttpRequestBody(ctx wrapper.HttpContext, pluginConfig config.PluginConfig | |||
} | |||
|
|||
func onHttpResponseHeaders(ctx wrapper.HttpContext, pluginConfig config.PluginConfig, log wrapper.Log) types.Action { | |||
if codeDetails, err := proxywasm.GetProperty([]string{"response", "code_details"}); err == nil && string(codeDetails) != "via_upstream" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段逻辑要不要在wrapper里加个工具函数,其他地方也可能会用到
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
Bypass the response body processing in ai-proxy if it is returned internally.
Ⅱ. Does this pull request fix one issue?
fixes #1145
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews