diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2023-09-21 14:51:42 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2023-10-05 12:30:48 +0200 |
commit | 62b10d5432ca40491cba700e4c2d70bcb3408ee5 (patch) | |
tree | ca50d2e63b0ed060219707e92a99825be3cb8460 /modules | |
parent | /views/*/{dst_subnet,protocols}: add, both backend+config (diff) | |
download | knot-resolver-62b10d5432ca40491cba700e4c2d70bcb3408ee5.tar.xz knot-resolver-62b10d5432ca40491cba700e4c2d70bcb3408ee5.zip |
/views/*/options: fix when used with e.g. tags
The issue is not now; it has always been broken in 6.x.
The model is that at most one view applies on any request.
If we need to do more things, they must happen as one meta-action.
test_view_insert_action(): dropped; can't see a suitable replacement
Diffstat (limited to 'modules')
-rw-r--r-- | modules/policy/policy.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 443fc0b0..60b03478 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -856,6 +856,16 @@ function policy.TAGS_ASSIGN(names) return 'policy.tags_assign_bitmap(' .. tostring(bitmap) .. ')' end +-- Perform a list of actions sequentially; meant for kr_view_insert_action(). +function policy.COMBINE(list) + if #list == 1 then return list[1] end + local r = 'function(state,req) ' + for _, item in ipairs(list) do + r = r .. item .. '(state,req); ' + end + return r .. 'end' +end + --[[ Insert a forwarding rule, i.e. override upstream for one DNS subtree. Throws lua exceptions when detecting something fishy. |