netutil: allow using * to match any hostname (#7111)

This commit is contained in:
Joe Chen
2022-07-25 21:38:15 +08:00
committed by GitHub
parent 780b33c639
commit db82024fc7
4 changed files with 5 additions and 1 deletions

View File

@@ -52,7 +52,7 @@ func init() {
// allowlist).
func IsBlockedLocalHostname(hostname string, allowlist []string) bool {
for _, allow := range allowlist {
if hostname == allow {
if hostname == allow || allow == "*" {
return false
}
}