Merge pull request #264 from safing/fix/negative-config-ints

Add validation to non-negative int config options
This commit is contained in:
Patrick Pacher 2021-03-11 14:25:09 +01:00 committed by GitHub
commit dd5273add7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -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

View file

@ -166,6 +166,7 @@ The format is: "protocol://ip:port?parameter=value&parameter=value"
config.UnitAnnotation: "seconds",
config.CategoryAnnotation: "Servers",
},
ValidationRegex: `^[1-9][0-9]{1,5}$`,
})
if err != nil {
return err