fix: reject invalid any and local config (#8133)

Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
Immanuel Tikhonov
2026-06-01 02:41:27 +04:00
committed by GitHub
parent ce0e5a6f39
commit 4c07a287da
4 changed files with 64 additions and 0 deletions

View File

@@ -9,6 +9,14 @@ import (
func init() { plugin.Register("local", setup) }
func setup(c *caddy.Controller) error {
c.Next() // 'local'
if c.NextArg() {
return plugin.Error("local", c.ArgErr())
}
if c.NextBlock() {
return plugin.Error("local", c.Errf("unknown property '%s'", c.Val()))
}
l := Local{}
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {