Skip to content

Commit 646b790

Browse files
committed
refactor code to use defaults
1 parent 4ab73f0 commit 646b790

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/aws-cpp-sdk-core/source/endpoint/BuiltInParameters.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace Endpoint
4242
static const char* FIPS_PREFIX = "fips-";
4343
static const char* FIPS_SUFFIX = "-fips";
4444
if (config.region.rfind(FIPS_PREFIX, 0) == 0) {
45+
// Backward compatibility layer for code hacking previous SDK version
4546
Aws::String regionOverride = config.region.substr(strlen(FIPS_PREFIX));
4647
forceFIPS = true;
4748
SetStringParameter(AWS_REGION, regionOverride);
@@ -62,12 +63,13 @@ namespace Endpoint
6263

6364
if (!config.endpointOverride.empty()) {
6465
OverrideEndpoint(config.endpointOverride, config.scheme);
66+
6567
if (config.region.empty()) {
6668
AWS_LOGSTREAM_WARN(ENDPOINT_BUILTIN_LOG_TAG,
6769
"Endpoint is overridden but region is not set. "
6870
"Region is required by many endpoint rule sets to resolve the endpoint. "
6971
"And it is required to compute an aws signature.");
70-
SetStringParameter(AWS_REGION, "region-not-set");
72+
SetStringParameter(AWS_REGION, "region-not-set"); // dummy endpoint resolution parameter
7173
}
7274
} else if (!serviceName.empty()) {
7375
Aws::String resolvedEndpoint = Aws::Config::EndpointResolver::EndpointSource(serviceName, config.profileName);

0 commit comments

Comments
 (0)