From 01dbc7cee4a7e79f8f7ee32f47e81e76a4ef117a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=AD=C3=B0=20Steinn=20Geirsson?= Date: Mon, 23 Mar 2026 11:34:16 +0000 Subject: [PATCH] Strip trailing slash from PVE host URLs A trailing slash in --pve.host (e.g. https://host:8006/) caused API requests to fail with status 500 due to double slashes in the path. --- collector/client.go | 5 +++++ 1 file changed, 5 insertions(+) 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