Skip to content
Snippets Groups Projects
Verified Commit 7dfda540 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

modules/policy: make postrules usable again

I didn't realize this mistake in c16728f5, released in 3.2.0.
It was fortunate that postrules have been rarely used so far.
parent 9a0835d1
No related branches found
No related tags found
No related merge requests found
......@@ -802,8 +802,7 @@ policy.layer = {
finish = function(state, req)
-- Optimization for the typical case
if #policy.postrules == 0 then return state end
-- Don't act on "resolved" cases.
if bit.band(state, bit.bor(kres.FAIL, kres.DONE)) ~= 0 then return state end
-- Act even on failed cases!
return policy.evaluate(policy.postrules, req, req:current(), state) or state
end
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment