diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-03-19 12:15:14 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-03-19 12:21:03 +0100 |
commit | e3a0dbdbc6b6c73a51d3f0ca7ba6e6a061123ea3 (patch) | |
tree | b978103091587a04626f2d57b775616893c8f9e5 /modules | |
parent | WIP: CI nits (diff) | |
download | knot-resolver-e3a0dbdbc6b6c73a51d3f0ca7ba6e6a061123ea3.tar.xz knot-resolver-e3a0dbdbc6b6c73a51d3f0ca7ba6e6a061123ea3.zip |
PoC: rate-limit everything for now :-)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/policy/policy.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 60b03478..10755556 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -934,9 +934,11 @@ policy.layer = { if ffi.C.kr_view_select_action(req, view_action_buf) == 0 then local act_str = ffi.string(view_action_buf[0].data, view_action_buf[0].len) - return loadstring('return '..act_str)()(state, req) + loadstring('return ' .. act_str)()(state, req) end + if ffi.C.kr_rrl_request_begin(req) then return end + local qry = req:initial() -- same as :current() but more descriptive return policy.evaluate(policy.rules, req, qry, state) or state |