mirror of
https://github.com/openappsec/attachment.git
synced 2025-08-14 05:45:57 +03:00
fix cleanup
This commit is contained in:
parent
a253345eb3
commit
ca329330f7
@ -35,6 +35,7 @@ function NanoHandler.access(conf)
|
|||||||
kong.ctx.plugin.session_id = session_id
|
kong.ctx.plugin.session_id = session_id
|
||||||
|
|
||||||
local meta_data = nano.handle_start_transaction()
|
local meta_data = nano.handle_start_transaction()
|
||||||
|
kong.log.err("Failed to handle start transaction - failing open")
|
||||||
local req_headers = nano.handleHeaders(headers)
|
local req_headers = nano.handleHeaders(headers)
|
||||||
|
|
||||||
local has_content_length = tonumber(ngx.var.http_content_length) and tonumber(ngx.var.http_content_length) > 0
|
local has_content_length = tonumber(ngx.var.http_content_length) and tonumber(ngx.var.http_content_length) > 0
|
||||||
@ -118,9 +119,10 @@ function NanoHandler.access(conf)
|
|||||||
|
|
||||||
if verdict == nano.AttachmentVerdict.DROP then
|
if verdict == nano.AttachmentVerdict.DROP then
|
||||||
nano.fini_session(session_data)
|
nano.fini_session(session_data)
|
||||||
nano.cleanup_all()
|
|
||||||
kong.ctx.plugin.blocked = true
|
kong.ctx.plugin.blocked = true
|
||||||
return nano.handle_custom_response(session_data, response)
|
local result = nano.handle_custom_response(session_data, response)
|
||||||
|
nano.cleanup_all()
|
||||||
|
return result
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
verdict, response = nano.end_inspection(session_id, session_data, nano.HttpChunkType.HTTP_REQUEST_END)
|
verdict, response = nano.end_inspection(session_id, session_data, nano.HttpChunkType.HTTP_REQUEST_END)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user