diff --git a/collector/client.go b/collector/client.go index 9c73f8d..6c9366e 100644 --- a/collector/client.go +++ b/collector/client.go @@ -41,6 +41,11 @@ func NewClient(hosts []string, token string, tlsInsecure bool, maxConcurrent int TLSHandshakeTimeout: 5 * time.Second, } + // Normalize hosts: strip trailing slashes + for i, h := range hosts { + hosts[i] = strings.TrimRight(h, "/") + } + // Normalize token: ensure it has the PVEAPIToken= prefix if !strings.HasPrefix(token, "PVEAPIToken=") { token = "PVEAPIToken=" + token