From 0fa717a78af33e2a04d3d3cd6913a316d408839e Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 1 Dec 2025 23:28:32 +0000 Subject: [PATCH] test: Add edge case for normalizeNodeHost URL parse error Control character (null byte) triggers url.Parse error, covering the 'invalid host format' error branch. Coverage: 96.3% to 100%. --- internal/api/config_handlers_host_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/api/config_handlers_host_test.go b/internal/api/config_handlers_host_test.go index 0e81857..fadf8df 100644 --- a/internal/api/config_handlers_host_test.go +++ b/internal/api/config_handlers_host_test.go @@ -385,6 +385,12 @@ func TestNormalizeNodeHost(t *testing.T) { nodeType: "pve", wantErr: true, }, + { + name: "control character in host returns error", + rawHost: "\x00invalid", + nodeType: "pve", + wantErr: true, + }, // Unknown node type (no default port added) { name: "unknown node type keeps host without port",