mirror of
https://github.com/openappsec/attachment.git
synced 2025-12-31 13:49:09 +03:00
add more logs
This commit is contained in:
@@ -90,8 +90,10 @@ function NanoHandler.access(conf)
|
|||||||
local chunk_count = 0
|
local chunk_count = 0
|
||||||
local start_time = ngx.now()
|
local start_time = ngx.now()
|
||||||
|
|
||||||
|
kong.log.err("Reading request body from file start time : ", start_time)
|
||||||
while true do
|
while true do
|
||||||
-- Check timeout
|
-- Check timeout
|
||||||
|
kong.log.err("Checking timeout for request body reading at ", ngx.now())
|
||||||
local elapsed = ngx.now() - start_time
|
local elapsed = ngx.now() - start_time
|
||||||
if elapsed > 3 then
|
if elapsed > 3 then
|
||||||
kong.log.warn("Request body reading timeout after ", elapsed, " seconds")
|
kong.log.warn("Request body reading timeout after ", elapsed, " seconds")
|
||||||
@@ -297,12 +299,11 @@ function NanoHandler.body_filter(conf)
|
|||||||
ngx.arg[2] = true
|
ngx.arg[2] = true
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
-- ACCEPT verdict - flush buffered data and switch to pass-through mode
|
kong.log.err("ACCEPT verdict in body_filter - flushing buffer and switching to pass-through chucnk :" , ctx.body_buffer_chunk)
|
||||||
kong.log.err("ACCEPT verdict in body_filter - flushing buffer and switching to pass-through")
|
|
||||||
local buffered_data = table.concat(ctx.response_buffer)
|
local buffered_data = table.concat(ctx.response_buffer)
|
||||||
kong.log.err("Flushing ", #ctx.response_buffer, " buffered chunks (", #buffered_data, " bytes) before switching to pass-through")
|
kong.log.err("Flushing ", #ctx.response_buffer, " buffered chunks (", #buffered_data, " bytes) before switching to pass-through")
|
||||||
ngx.arg[1] = buffered_data
|
ngx.arg[1] = buffered_data
|
||||||
ctx.response_buffer = nil -- Clear buffer to free memory
|
ctx.response_buffer = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user