]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
policy: fix incompatibility with default (nil) phase
authorMarek Vavruša <mvavrusa@cloudflare.com>
Tue, 19 Jun 2018 21:50:20 +0000 (14:50 -0700)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 7 Sep 2018 17:45:21 +0000 (10:45 -0700)
The `{ nil }` would otherwise get interpreted as an empty table.

modules/policy/policy.lua

index b1f55e16a0b9a8a4809c3b524da02d26ea560275..9db1fc68c62611e38d1848b25b6874fa43dc8aea 100644 (file)
@@ -635,7 +635,7 @@ function policy.add(rule, phase)
        -- End of compatibility shim
        local desc = {id=getruleid(), cb=rule, count=0}
        if type(phase) ~= 'table' then
-               phase = {phase}
+               phase = {phase or 'begin'}
        end
        -- Allow multiple phases for the same rule
        for _, p in ipairs(phase) do