From 69b1578523fe50359327d75c373e97b9873bb043 Mon Sep 17 00:00:00 2001 From: wiaamm Date: Sat, 6 Dec 2025 22:25:43 +0200 Subject: [PATCH] add new flag for bypass inspections --- .../kong/plugins/open-appsec-waf-kong-plugin/handler.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 fd5a49c..f824690 100755 --- a/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua +++ b/attachments/kong/plugins/open-appsec-waf-kong-plugin/handler.lua @@ -32,8 +32,7 @@ function NanoHandler.access(conf) user_agent:match("Go%-http%-client") or -- Common health checker (method == "GET" and path == "/") then -- Root path health checks kong.log.debug("Bypassing inspection for internal request: ", method, " ", path, " (UA: ", user_agent, ")") - kong.ctx.plugin.session_data = nil - kong.ctx.plugin.session_id = nil + kong.ctx.plugin.bypass_inspection = true return end @@ -212,7 +211,7 @@ end function NanoHandler.header_filter(conf) local ctx = kong.ctx.plugin - if ctx.blocked then + if ctx.blocked or ctx.bypass_inspection then return end @@ -251,7 +250,7 @@ end function NanoHandler.body_filter(conf) local ctx = kong.ctx.plugin - if ctx.blocked then + if ctx.blocked or ctx.bypass_inspection then return end