]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
prefill: mandate explicit URL configuration
authorPetr Špaček <petr.spacek@nic.cz>
Wed, 18 Apr 2018 10:45:16 +0000 (12:45 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Wed, 18 Apr 2018 15:08:29 +0000 (17:08 +0200)
Default values would cause confusion when we introduce support for
non-root zones.

modules/prefill/prefill.lua

index 2b30738f7cf052a1acb4d88e1124ce5c71e99f8b..ee706bd3eaa416f4c86e9e20f710a78fb944a3d0 100644 (file)
@@ -174,6 +174,13 @@ local function config_zone(zone_cfg)
                dir_obj:close()
        end
        rz_ca_dir = zone_cfg.ca_dir
+
+       if not zone_cfg.url or not string.match(zone_cfg.url, '^https://') then
+               error('[prefill] option url must contain a '
+                       .. 'https:// URL of a zone file')
+       else
+               rz_url = zone_cfg.url
+       end
 end
 
 function prefill.config(config)