diff --git a/plugin/ready/setup.go b/plugin/ready/setup.go index a7bf2c620..db1a7063f 100644 --- a/plugin/ready/setup.go +++ b/plugin/ready/setup.go @@ -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()) } } } diff --git a/plugin/ready/setup_test.go b/plugin/ready/setup_test.go index c7900dc89..4ee1e3455 100644 --- a/plugin/ready/setup_test.go +++ b/plugin/ready/setup_test.go @@ -58,6 +58,13 @@ ready localhost:1234 { input: ` ready localhost:1234 { monitor 404 +}`, + shouldErr: true, + }, + { + input: ` +ready { + monitro continuously }`, shouldErr: true, },