1
0
Fork 0

Merge current v2.9 into v3.0

This commit is contained in:
romain 2023-02-15 11:29:28 +01:00
commit 241fb5093a
18 changed files with 386 additions and 116 deletions

View file

@ -67,7 +67,7 @@ func clientIP(tree *matchersTree, clientIP ...string) error {
return nil
}
var almostFQDN = regexp.MustCompile(`^[[:alnum:]\.-]+$`)
var hostOrIP = regexp.MustCompile(`^[[:alnum:]\.\-\:]+$`)
// hostSNI checks if the SNI Host of the connection match the matcher host.
func hostSNI(tree *matchersTree, hosts ...string) error {
@ -80,7 +80,7 @@ func hostSNI(tree *matchersTree, hosts ...string) error {
return nil
}
if !almostFQDN.MatchString(host) {
if !hostOrIP.MatchString(host) {
return fmt.Errorf("invalid value for HostSNI matcher, %q is not a valid hostname", host)
}