Enhance just one wildcard matching for host patterns

This commit is contained in:
sharego 2026-06-14 13:00:43 +08:00 committed by GitHub
parent 39c9a85f80
commit ec368396ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -342,7 +342,11 @@ outer:
}
host = repl.ReplaceAll(host, "")
if strings.Contains(host, "*") {
// a single * always match
if host == "*" {
return true, nil
} if strings.Contains(host, "*") {
patternParts := strings.Split(host, ".")
incomingParts := strings.Split(reqHost, ".")
if len(patternParts) != len(incomingParts) {