From b60427c68b82f73c141a21de8aca129593c5005d Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 23 Feb 2021 22:45:08 +0100 Subject: [PATCH] Add validation to non-negative int config options --- firewall/config.go | 1 + resolver/config.go | 1 + 2 files changed, 2 insertions(+) diff --git a/firewall/config.go b/firewall/config.go index cd7a4d2a..3d5e3f0b 100644 --- a/firewall/config.go +++ b/firewall/config.go @@ -76,6 +76,7 @@ func registerConfig() error { config.UnitAnnotation: "seconds", config.CategoryAnnotation: "General", }, + ValidationRegex: `^[1-9][0-9]{1,5}?$`, }) if err != nil { return err diff --git a/resolver/config.go b/resolver/config.go index 2a360d82..85a22063 100644 --- a/resolver/config.go +++ b/resolver/config.go @@ -166,6 +166,7 @@ The format is: "protocol://ip:port?parameter=value¶meter=value" config.UnitAnnotation: "seconds", config.CategoryAnnotation: "Servers", }, + ValidationRegex: `^[1-9][0-9]{1,5}?$`, }) if err != nil { return err