🐛 Add / in regexp for LAPI key (#117)

This commit is contained in:
mathieuHa
2023-09-24 13:56:19 +02:00
committed by GitHub
parent 1a9bdc578f
commit fc3da2fc2d

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())
}