mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:29:57 +00:00
CUSTESC-23757: Fix a bug where a wildcard ingress rule would match an host without starting with a dot
This commit is contained in:
@@ -58,7 +58,7 @@ func matchHost(ruleHost, reqHost string) bool {
|
||||
|
||||
// Validate hostnames that use wildcards at the start
|
||||
if strings.HasPrefix(ruleHost, "*.") {
|
||||
toMatch := strings.TrimPrefix(ruleHost, "*.")
|
||||
toMatch := strings.TrimPrefix(ruleHost, "*")
|
||||
return strings.HasSuffix(reqHost, toMatch)
|
||||
}
|
||||
return false
|
||||
|
Reference in New Issue
Block a user