Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Snowflake.Data.Tests/UnitTests/SFS3ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ public void TestAppendHttpsToEndpoint()
var amazonS3Client = new AmazonS3Config();
var endpoint = "endpointWithNoHttps.com";
var expectedEndpoint = "https://endpointWithNoHttps.com";
var mockRegion = "fakeRegion";

// ACT
SFS3Client.SetCommonClientConfig(amazonS3Client, string.Empty, endpoint, 1, 0);
SFS3Client.SetCommonClientConfig(amazonS3Client, mockRegion, endpoint, 1, 0);

// Assert
Assert.That(amazonS3Client.ServiceURL, Is.EqualTo(expectedEndpoint));
Expand All @@ -226,9 +227,10 @@ public void TestAppendHttpsToEndpointWithBrackets()
var amazonS3Client = new AmazonS3Config();
var endpoint = "[endpointWithNoHttps.com]";
var expectedEndpoint = "https://endpointWithNoHttps.com";
var mockRegion = "fakeRegion";

// ACT
SFS3Client.SetCommonClientConfig(amazonS3Client, string.Empty, endpoint, 1, 0);
SFS3Client.SetCommonClientConfig(amazonS3Client, mockRegion, endpoint, 1, 0);

// Assert
Assert.That(amazonS3Client.ServiceURL, Is.EqualTo(expectedEndpoint));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,10 @@ internal static void SetCommonClientConfig(

clientConfig.ServiceURL = endpoint;
}

// The region information used to determine the endpoint for the service.
// RegionEndpoint and ServiceURL are mutually exclusive properties.
// If both stageInfo.endPoint and stageInfo.region have a value, stageInfo.region takes
// precedence and ServiceUrl will be reset to null.
if ((null != region) && (0 != region.Length))
// If both stageInfo.endPoint and stageInfo.region have a value, the endPoint takes precedence
else if ((null != region) && (0 != region.Length))
{
RegionEndpoint regionEndpoint = RegionEndpoint.GetBySystemName(region);
clientConfig.RegionEndpoint = regionEndpoint;
Expand Down
Loading