diff --git a/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua b/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua index d19458d..3634e83 100755 --- a/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua +++ b/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua @@ -220,7 +220,8 @@ function NanoHandler.body_filter(conf) local full_body = kong.response.get_raw_body() local is_streaming = (full_body == nil and chunk ~= nil) - if not full_body and not chunk and not eof then + -- Return early for empty/nil chunks that aren't EOF + if not eof and (not chunk or (type(chunk) == "string" and #chunk == 0)) and not full_body then return end