mirror of
https://github.com/openappsec/attachment.git
synced 2025-12-31 13:49:09 +03:00
returning to last working version ...
This commit is contained in:
@@ -248,12 +248,6 @@ function NanoHandler.body_filter(conf)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if session is already finalized (like Envoy/nginx do)
|
|
||||||
if nano.is_session_finalized(ctx.session_data) then
|
|
||||||
kong.log.debug("Skipping already inspected session")
|
|
||||||
return -- Let remaining data pass through
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Initialize timeout tracking on first chunk
|
-- Initialize timeout tracking on first chunk
|
||||||
if not ctx.body_filter_start_time then
|
if not ctx.body_filter_start_time then
|
||||||
ctx.body_filter_start_time = ngx.now() * 1000
|
ctx.body_filter_start_time = ngx.now() * 1000
|
||||||
@@ -319,8 +313,6 @@ function NanoHandler.body_filter(conf)
|
|||||||
|
|
||||||
-- Process EOF
|
-- Process EOF
|
||||||
if eof then
|
if eof then
|
||||||
-- Only send end_inspection if session not already finalized
|
|
||||||
if not nano.is_session_finalized(ctx.session_data) then
|
|
||||||
local ok, result = pcall(function()
|
local ok, result = pcall(function()
|
||||||
return {nano.end_inspection(ctx.session_id, ctx.session_data, nano.HttpChunkType.HTTP_RESPONSE_END)}
|
return {nano.end_inspection(ctx.session_id, ctx.session_data, nano.HttpChunkType.HTTP_RESPONSE_END)}
|
||||||
end)
|
end)
|
||||||
@@ -342,7 +334,6 @@ function NanoHandler.body_filter(conf)
|
|||||||
else
|
else
|
||||||
kong.log.err("nano.end_inspection failed: ", tostring(result), " - cleaning up session")
|
kong.log.err("nano.end_inspection failed: ", tostring(result), " - cleaning up session")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Clean up session at EOF
|
-- Clean up session at EOF
|
||||||
if not ctx.inspection_complete then
|
if not ctx.inspection_complete then
|
||||||
|
|||||||
Reference in New Issue
Block a user