From 466acc61cc199c00722c3be40bb4cc20bd12eed8 Mon Sep 17 00:00:00 2001 From: wiaamm Date: Sun, 30 Nov 2025 00:12:42 +0200 Subject: [PATCH] add more check --- .../kong/plugins/open-appsec-waf-kong-plugin/handler.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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