From 1ec501938a824406a82e08fd22d507cc26541013 Mon Sep 17 00:00:00 2001 From: Vivek Reddy Date: Tue, 26 Nov 2024 15:16:04 -0800 Subject: [PATCH] removed trailing / if exist in url Signed-off-by: Vivek Reddy --- pkg/splunk/client/azureblobclient.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/splunk/client/azureblobclient.go b/pkg/splunk/client/azureblobclient.go index 679a113f4..c74036269 100644 --- a/pkg/splunk/client/azureblobclient.go +++ b/pkg/splunk/client/azureblobclient.go @@ -138,6 +138,9 @@ func NewAzureBlobClient( var serviceURL string if endpoint != "" { serviceURL = endpoint + if serviceURL[len(serviceURL)-1] == '/' { + serviceURL = serviceURL[:len(serviceURL)-1] + } } else if region != "" { serviceURL = fmt.Sprintf("https://%s.blob.%s.core.windows.net", storageAccountName, region) } else { @@ -203,7 +206,7 @@ func NewAzureBlobClient( // Initialize the container client with Token Credential. rawContainerClient, err := container.NewClient( - fmt.Sprintf("%s%s", serviceURL, bucketName), + fmt.Sprintf("%s/%s", serviceURL, bucketName), tokenCredential, nil, )