summaryrefslogtreecommitdiffstats
path: root/modules/daf
diff options
context:
space:
mode:
authorPetr Špaček <petr.spacek@nic.cz>2020-03-31 17:31:00 +0200
committerTomas Krizek <tomas.krizek@nic.cz>2020-04-02 13:57:32 +0200
commit027b66fb3e7b0d61f8104d8498842e00ced53d03 (patch)
tree48b7cf988c33fbe0a8aafd05ed6357807b989d76 /modules/daf
parentdaf: config tests for HTTP API (diff)
downloadknot-resolver-027b66fb3e7b0d61f8104d8498842e00ced53d03.tar.xz
knot-resolver-027b66fb3e7b0d61f8104d8498842e00ced53d03.zip
daf: fix add() handling of empty rule strings
Diffstat (limited to 'modules/daf')
-rw-r--r--modules/daf/daf.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/daf/daf.lua b/modules/daf/daf.lua
index 0ddb62b2..282d03e9 100644
--- a/modules/daf/daf.lua
+++ b/modules/daf/daf.lua
@@ -75,6 +75,9 @@ end
local function parse_rule(g)
-- Allow action without filter
local tok = g()
+ if tok == nil then
+ error('empty rule is not allowed')
+ end
if not filters[tok:lower()] then
return tok, nil
end