]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
prefill module: allow a different module-loading style
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 5 Sep 2019 14:38:59 +0000 (16:38 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 17 Sep 2019 14:10:50 +0000 (16:10 +0200)
Otherwise plain `modules = { 'prefill' }` will error out,
which is surprising wrt. to style used/allowed by other modules.

NEWS
modules/prefill/prefill.lua

diff --git a/NEWS b/NEWS
index b1c2ab83e3ac05e4bc445c07b4fd7a1953d19104..72b55fd533d4ea9e0786dd8f5a2e85735e9ab380 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Bugfixes
 - rebinding module: fix handling some requests, respect ALLOW_LOCAL flag
 - fix incorrect SERVFAIL on cached bogus answer for +cd request (!860)
   (regression since 4.1.0 release, in less common cases)
+- prefill module: allow a different module-loading style (#506)
 
 
 Knot Resolver 4.2.0 (2019-08-05)
index c573ed9e8e75473e0829f3b3ff81bca6e3786a4b..1f99d2d1062aa8d2078e19952ef104a9a35f6226 100644 (file)
@@ -181,8 +181,9 @@ local function config_zone(zone_cfg)
 end
 
 function prefill.config(config)
+       if config == nil then return end -- e.g. just modules = { 'prefill' }
        local root_configured = false
-       if not config or type(config) ~= 'table' then
+       if type(config) ~= 'table' then
                error('[prefill] configuration must be in table '
                        .. '{owner name = {per-zone config}}')
        end