From 57260d6193b58ef4896144f7381b5f715eff0b4a Mon Sep 17 00:00:00 2001 From: wiaamm Date: Sun, 14 Dec 2025 11:23:36 +0200 Subject: [PATCH] add missing content-length update --- .../kong/plugins/open-appsec-waf-kong-plugin/handler.lua | 3 +++ 1 file changed, 3 insertions(+) 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 cd06a06..2548165 100755 --- a/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua +++ b/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua @@ -300,6 +300,9 @@ function NanoHandler.body_filter(conf) return else local buffered_data = table.concat(ctx.response_buffer) + local original_content_length = tonumber(ngx.header["Content-Length"]) or #buffered_data + local total_diff = ctx.content_length_diff or 0 + ngx.header["Content-Length"] = original_content_length + total_diff ngx.arg[1] = buffered_data ctx.response_buffer = nil return