feat(domain): 支持通配符域名及关联功能适配 (#63)

* feat(domain): 支持通配符域名及关联功能适配

* fix(domain): preserve legacy Unicode imports and address review findings

* fix(domain): canonicalize legacy IDNs and exclude empty host labels

* fix(domain): normalize equivalent Unicode IDN spellings

---------

Co-authored-by: Ryan <63696351+Rain-kl@users.noreply.github.com>
Co-authored-by: ryan <ryan@arctel.net>
This commit is contained in:
Deqiying
2026-11-09 10:31:03 +08:00
committed by GitHub
parent 8d8b3e1ea8
commit 9a51a68206
37 changed files with 1614 additions and 113 deletions
+10 -4
View File
@@ -229,11 +229,17 @@ func routeMonitorURL(ctx context.Context, route *model.ProxyRoute) (string, erro
if len(domains) == 0 {
return "", fmt.Errorf("route %s has no zone domains", route.SiteName)
}
domain := domains[0].Domain
if route.EnableHTTPS {
return "https://" + domain, nil
// 通配符是匹配规则而非可探测地址;混合绑定时选择具体域名。
for _, domain := range domains {
if strings.Contains(domain.Domain, "*") {
continue
}
if route.EnableHTTPS {
return "https://" + domain.Domain, nil
}
return "http://" + domain.Domain, nil
}
return "http://" + domain, nil
return "", fmt.Errorf("route %s only has wildcard domains; bind a concrete hostname for monitoring", route.SiteName)
}
func monitorPayload(id int, name, targetURL string, config *kumaConfig) map[string]any {