From: Vladimír Čunát Date: Thu, 5 Sep 2019 14:38:59 +0000 (+0200) Subject: prefill module: allow a different module-loading style X-Git-Tag: v4.2.1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46b582dc25f0bbc5cc432ae49be62e95f8b7fc86;p=thirdparty%2Fknot-resolver.git prefill module: allow a different module-loading style Otherwise plain `modules = { 'prefill' }` will error out, which is surprising wrt. to style used/allowed by other modules. --- diff --git a/NEWS b/NEWS index b1c2ab83e..72b55fd53 100644 --- 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) diff --git a/modules/prefill/prefill.lua b/modules/prefill/prefill.lua index c573ed9e8..1f99d2d10 100644 --- a/modules/prefill/prefill.lua +++ b/modules/prefill/prefill.lua @@ -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