🐛 Update regex to support = in lapikey update some exemples with 1.5.3 crowdsec (#115)

This commit is contained in:
mathieuHa
2023-09-19 20:57:29 +02:00
committed by GitHub
parent 2827fef273
commit f2aea695fc
4 changed files with 13 additions and 15 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ func ValidateParams(config *Config) error {
// valid ! # $ % & ' * + - . ^ _ ` | ~ DIGIT ALPHA
// See https://httpwg.github.io/specs/rfc7230.html#rule.token.separators
func validateParamsAPIKey(lapiKey string) error {
reg := regexp.MustCompile("^[a-zA-Z0-9 !#$%&'*+-.^_`|~]*$")
reg := regexp.MustCompile("^[a-zA-Z0-9 !#$%&'*+-.^_`|~=]*$")
if !reg.Match([]byte(lapiKey)) {
return fmt.Errorf("CrowdsecLapiKey doesn't valid this regexp: '/%s/'", reg.String())
}