fix wrong close statement

This commit is contained in:
wiaamm
2025-12-01 00:25:05 +02:00
parent 4787c326e2
commit 8bdf7a4dd4

View File

@@ -93,6 +93,7 @@ function NanoHandler.access(conf)
local result = nano.handle_custom_response(session_data, response) local result = nano.handle_custom_response(session_data, response)
nano.cleanup_all() nano.cleanup_all()
return result return result
end
else else
kong.log.err("Request body not in memory, attempting to read from buffer/file") kong.log.err("Request body not in memory, attempting to read from buffer/file")
@@ -104,6 +105,7 @@ function NanoHandler.access(conf)
nano.fini_session(session_data) nano.fini_session(session_data)
kong.ctx.plugin.blocked = true kong.ctx.plugin.blocked = true
return nano.handle_custom_response(session_data, response) return nano.handle_custom_response(session_data, response)
end
else else
local body_file = ngx.var.request_body_file local body_file = ngx.var.request_body_file
if body_file then if body_file then
@@ -149,6 +151,8 @@ function NanoHandler.access(conf)
local result = nano.handle_custom_response(session_data, response) local result = nano.handle_custom_response(session_data, response)
nano.cleanup_all() nano.cleanup_all()
return result return result
end
end
else else
local ok, verdict, response = pcall(function() local ok, verdict, response = pcall(function()
return nano.end_inspection(session_id, session_data, nano.HttpChunkType.HTTP_REQUEST_END) return nano.end_inspection(session_id, session_data, nano.HttpChunkType.HTTP_REQUEST_END)
@@ -304,6 +308,7 @@ function NanoHandler.body_filter(conf)
ctx.body_buffer_chunk = ctx.body_buffer_chunk + 1 ctx.body_buffer_chunk = ctx.body_buffer_chunk + 1
end end
end end
end
if eof or (ctx.expect_body == false and not ctx.body_seen) then if eof or (ctx.expect_body == false and not ctx.body_seen) then
local ok, result = pcall(function() local ok, result = pcall(function()