mirror of
https://github.com/openappsec/attachment.git
synced 2026-01-02 14:44:42 +03:00
move check
This commit is contained in:
@@ -17,10 +17,6 @@ function NanoHandler.access(conf)
|
|||||||
|
|
||||||
-- Check if we already have a finalized session from a previous phase
|
-- Check if we already have a finalized session from a previous phase
|
||||||
local ctx = kong.ctx.plugin
|
local ctx = kong.ctx.plugin
|
||||||
if nano.is_session_finalized(ctx.session_data) then
|
|
||||||
kong.log.info("Session has already been inspected, no need for further inspection")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local headers = kong.request.get_headers()
|
local headers = kong.request.get_headers()
|
||||||
local session_id = nano.generate_session_id()
|
local session_id = nano.generate_session_id()
|
||||||
@@ -36,6 +32,10 @@ function NanoHandler.access(conf)
|
|||||||
|
|
||||||
kong.ctx.plugin.session_data = session_data
|
kong.ctx.plugin.session_data = session_data
|
||||||
kong.ctx.plugin.session_id = session_id
|
kong.ctx.plugin.session_id = session_id
|
||||||
|
if nano.is_session_finalized(session_id) then
|
||||||
|
kong.log.info("Session has already been inspected, no need for further inspection")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local meta_data = nano.handle_start_transaction()
|
local meta_data = nano.handle_start_transaction()
|
||||||
kong.ctx.plugin.meta_data = meta_data -- Keep reference to prevent GC
|
kong.ctx.plugin.meta_data = meta_data -- Keep reference to prevent GC
|
||||||
|
|||||||
Reference in New Issue
Block a user