mirror of
https://github.com/alibaba/higress.git
synced 2026-04-21 12:07:26 +08:00
fix: Skip reading non-JSON request bodies in ai-proxy (#1914)
This commit is contained in:
@@ -91,6 +91,11 @@ func onHttpRequestHeader(ctx wrapper.HttpContext, pluginConfig config.PluginConf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if contentType, _ := proxywasm.GetHttpRequestHeader(util.HeaderContentType); contentType != "" && !strings.Contains(contentType, util.MimeTypeApplicationJson) {
|
||||||
|
ctx.DontReadRequestBody()
|
||||||
|
log.Debugf("[onHttpRequestHeader] unsupported content type: %s, will not process the request body", contentType)
|
||||||
|
}
|
||||||
|
|
||||||
if apiName == "" {
|
if apiName == "" {
|
||||||
ctx.DontReadRequestBody()
|
ctx.DontReadRequestBody()
|
||||||
ctx.DontReadResponseBody()
|
ctx.DontReadResponseBody()
|
||||||
|
|||||||
Reference in New Issue
Block a user