mirror of
https://github.com/coredns/coredns.git
synced 2026-07-23 16:10:10 -04:00
plugin/hosts: make unsupported type fallthrough opt-in (#8282)
This commit is contained in:
@@ -112,6 +112,11 @@ func hostsParse(c *caddy.Controller) (Hosts, error) {
|
||||
switch c.Val() {
|
||||
case "fallthrough":
|
||||
h.Fall.SetZonesFromArgs(c.RemainingArgs())
|
||||
case "fallthrough_unsupported":
|
||||
if len(c.RemainingArgs()) != 0 {
|
||||
return h, c.ArgErr()
|
||||
}
|
||||
h.fallthroughUnsupported = true
|
||||
case "no_reverse":
|
||||
h.options.autoReverse = false
|
||||
case "ttl":
|
||||
@@ -150,6 +155,9 @@ func hostsParse(c *caddy.Controller) (Hosts, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if h.fallthroughUnsupported && len(h.Fall.Zones) == 0 {
|
||||
return h, c.Err("fallthrough_unsupported requires fallthrough")
|
||||
}
|
||||
|
||||
h.initInline(inline)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user