fix: harden address parsing edge cases

This commit is contained in:
ZacharyZcR
2026-06-01 04:03:46 +08:00
parent 8ec96bfe6d
commit 569d21a8bc
43 changed files with 273 additions and 137 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ func (p *ElasticsearchPlugin) testCredential(ctx context.Context, info *common.H
if info.Port == 9443 {
protocol = "https"
}
url := fmt.Sprintf("%s://%s:%d/", protocol, info.Host, info.Port)
url := fmt.Sprintf("%s://%s/", protocol, info.Target())
req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
if err != nil {