mirror of
https://github.com/alibaba/higress.git
synced 2026-05-01 08:57:27 +08:00
ignore binary body in plugins (#711)
This commit is contained in:
@@ -263,6 +263,10 @@ func (ctx *CommonHttpCtx[PluginConfig]) OnHttpRequestHeaders(numHeaders int, end
|
||||
return types.ActionContinue
|
||||
}
|
||||
ctx.config = config
|
||||
// To avoid unexpected operations, plugins do not read the binary content body
|
||||
if IsBinaryRequestBody() {
|
||||
ctx.needRequestBody = false
|
||||
}
|
||||
if ctx.plugin.vm.onHttpRequestHeaders == nil {
|
||||
return types.ActionContinue
|
||||
}
|
||||
@@ -295,6 +299,10 @@ func (ctx *CommonHttpCtx[PluginConfig]) OnHttpResponseHeaders(numHeaders int, en
|
||||
if ctx.config == nil {
|
||||
return types.ActionContinue
|
||||
}
|
||||
// To avoid unexpected operations, plugins do not read the binary content body
|
||||
if IsBinaryResponseBody() {
|
||||
ctx.needResponseBody = false
|
||||
}
|
||||
if ctx.plugin.vm.onHttpResponseHeaders == nil {
|
||||
return types.ActionContinue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user