mirror of
https://github.com/openappsec/attachment.git
synced 2025-12-31 13:49:09 +03:00
remove processed_requests
This commit is contained in:
@@ -8,9 +8,6 @@ local NanoHandler = {}
|
|||||||
NanoHandler.PRIORITY = 3000
|
NanoHandler.PRIORITY = 3000
|
||||||
NanoHandler.VERSION = "1.0.0"
|
NanoHandler.VERSION = "1.0.0"
|
||||||
|
|
||||||
NanoHandler.sessions = {}
|
|
||||||
NanoHandler.processed_requests = {}
|
|
||||||
|
|
||||||
function NanoHandler.init_worker()
|
function NanoHandler.init_worker()
|
||||||
nano.init_attachment()
|
nano.init_attachment()
|
||||||
end
|
end
|
||||||
@@ -20,11 +17,6 @@ function NanoHandler.access(conf)
|
|||||||
local session_id = nano.generate_session_id()
|
local session_id = nano.generate_session_id()
|
||||||
kong.service.request.set_header("x-session-id", tostring(session_id))
|
kong.service.request.set_header("x-session-id", tostring(session_id))
|
||||||
|
|
||||||
if NanoHandler.processed_requests[session_id] then
|
|
||||||
kong.ctx.plugin.blocked = true
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local session_data = nano.init_session(session_id)
|
local session_data = nano.init_session(session_id)
|
||||||
if not session_data then
|
if not session_data then
|
||||||
kong.log.err("Failed to initialize session - failing open")
|
kong.log.err("Failed to initialize session - failing open")
|
||||||
@@ -143,8 +135,6 @@ function NanoHandler.access(conf)
|
|||||||
return nano.handle_custom_response(session_data, response)
|
return nano.handle_custom_response(session_data, response)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
NanoHandler.processed_requests[session_id] = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function NanoHandler.header_filter(conf)
|
function NanoHandler.header_filter(conf)
|
||||||
|
|||||||
Reference in New Issue
Block a user