From 8233727db4c824962e80e8e915338635df9e73df Mon Sep 17 00:00:00 2001 From: Din Music Date: Fri, 29 Nov 2024 10:35:14 +0000 Subject: [PATCH] provider-config: Test appending port when URL contains path Signed-off-by: Din Music --- internal/provider-config/config_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/provider-config/config_test.go b/internal/provider-config/config_test.go index d3111a11..f7a0c0fb 100644 --- a/internal/provider-config/config_test.go +++ b/internal/provider-config/config_test.go @@ -52,6 +52,18 @@ func TestDetermineLXDAddress(t *testing.T) { Address: "https://localhost:1234", Expect: "https://localhost:1234", }, + { + Name: "Scheme, hostname, port | URL path", + Protocol: "simplestreams", + Address: "https://example.com/cloud-images/releases", + Expect: "https://example.com:443/cloud-images/releases", + }, + { + Name: "Scheme, hostname, port | URL path with preconfigured port", + Protocol: "simplestreams", + Address: "https://example.com:1234/cloud-images/releases", + Expect: "https://example.com:1234/cloud-images/releases", + }, // Expected errors. { Name: "Unsupported simplestreams scheme",