From 1fbc686758ecbe47739202bfba2e07fe80424d97 Mon Sep 17 00:00:00 2001 From: Immanuel Tikhonov <122638311+immanuwell@users.noreply.github.com> Date: Thu, 21 May 2026 23:29:59 +0400 Subject: [PATCH] fix: reject unknown ready plugin properties (#8119) Signed-off-by: immanuwell --- plugin/ready/setup.go | 5 ++++- plugin/ready/setup_test.go | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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, },