mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
fix: update get_reason function to correctly retrieve security mode from context
This commit is contained in:
parent
a5ef0d23eb
commit
d809f2f8a0
1 changed files with 4 additions and 4 deletions
|
|
@ -288,10 +288,10 @@ end
|
|||
|
||||
utils.get_reason = function(ctx)
|
||||
-- ngx.ctx
|
||||
if ctx and ctx.bw and ctx.bw.reason then
|
||||
return ctx.bw.reason, ctx.bw.reason_data or {}, ctx.bw.security_mode
|
||||
end
|
||||
local security_mode = utils.get_security_mode(ctx)
|
||||
if ctx and ctx.bw and ctx.bw.reason then
|
||||
return ctx.bw.reason, ctx.bw.reason_data or {}, security_mode
|
||||
end
|
||||
-- ngx.var
|
||||
local var_reason = var.reason
|
||||
if var_reason and var_reason ~= "" then
|
||||
|
|
@ -575,7 +575,7 @@ utils.get_deny_status = function()
|
|||
end
|
||||
|
||||
utils.get_security_mode = function(ctx)
|
||||
local security_mode, err = utils.get_variable("SECURITY_MODE", true, ctx)
|
||||
local security_mode, _ = utils.get_variable("SECURITY_MODE", true, ctx)
|
||||
if not security_mode then
|
||||
return "block"
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue