add new flag for bypass inspections

This commit is contained in:
wiaamm
2025-12-06 22:25:43 +02:00
parent 5faf21a4c9
commit 69b1578523

View File

@@ -32,8 +32,7 @@ function NanoHandler.access(conf)
user_agent:match("Go%-http%-client") or -- Common health checker user_agent:match("Go%-http%-client") or -- Common health checker
(method == "GET" and path == "/") then -- Root path health checks (method == "GET" and path == "/") then -- Root path health checks
kong.log.debug("Bypassing inspection for internal request: ", method, " ", path, " (UA: ", user_agent, ")") kong.log.debug("Bypassing inspection for internal request: ", method, " ", path, " (UA: ", user_agent, ")")
kong.ctx.plugin.session_data = nil kong.ctx.plugin.bypass_inspection = true
kong.ctx.plugin.session_id = nil
return return
end end
@@ -212,7 +211,7 @@ end
function NanoHandler.header_filter(conf) function NanoHandler.header_filter(conf)
local ctx = kong.ctx.plugin local ctx = kong.ctx.plugin
if ctx.blocked then if ctx.blocked or ctx.bypass_inspection then
return return
end end
@@ -251,7 +250,7 @@ end
function NanoHandler.body_filter(conf) function NanoHandler.body_filter(conf)
local ctx = kong.ctx.plugin local ctx = kong.ctx.plugin
if ctx.blocked then if ctx.blocked or ctx.bypass_inspection then
return return
end end