mirror of
https://github.com/coredns/coredns.git
synced 2026-05-25 11:20:23 -04:00
fix: reject unknown ready plugin properties (#8119)
Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
committed by
GitHub
parent
3e762bc603
commit
1fbc686758
@@ -90,7 +90,8 @@ func parse(c *caddy.Controller) (string, monitorType, error) {
|
||||
}
|
||||
|
||||
for c.NextBlock() {
|
||||
if c.Val() == "monitor" {
|
||||
switch c.Val() {
|
||||
case "monitor":
|
||||
args := c.RemainingArgs()
|
||||
if len(args) != 1 {
|
||||
return "", "", c.ArgErr()
|
||||
@@ -101,6 +102,8 @@ func parse(c *caddy.Controller) (string, monitorType, error) {
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
default:
|
||||
return "", "", c.Errf("unknown property '%s'", c.Val())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,13 @@ ready localhost:1234 {
|
||||
input: `
|
||||
ready localhost:1234 {
|
||||
monitor 404
|
||||
}`,
|
||||
shouldErr: true,
|
||||
},
|
||||
{
|
||||
input: `
|
||||
ready {
|
||||
monitro continuously
|
||||
}`,
|
||||
shouldErr: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user