Skip to content

Commit

Permalink
Align request compression config options to other SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbiscigl committed Jan 22, 2024
1 parent cf0c907 commit 5b6ad60
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace Client
{

static const char* CLIENT_CONFIG_TAG = "ClientConfiguration";
static const char* USE_REQUEST_COMPRESSION_ENV_VAR = "USE_REQUEST_COMPRESSION";
static const char* USE_REQUEST_COMPRESSION_CONFIG_VAR = "use_request_compression";
static const char* DISABLE_REQUEST_COMPRESSION_ENV_VAR = "DISABLE_REQUEST_COMPRESSION";
static const char* DISABLE_REQUEST_COMPRESSION_CONFIG_VAR = "disable_request_compression";
static const char* REQUEST_MIN_COMPRESSION_SIZE_BYTES_ENV_VAR = "REQUEST_MIN_COMPRESSION_SIZE_BYTES";
static const char* REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_VAR = "request_min_compression_size_bytes";
static const char* AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
Expand Down Expand Up @@ -142,15 +142,15 @@ void setLegacyClientConfigurationParameters(ClientConfiguration& clientConfig)
clientConfig.enableHostPrefixInjection = true;
clientConfig.profileName = Aws::Auth::GetConfigProfileName();

Aws::String useCompressionConfig = clientConfig.LoadConfigFromEnvOrProfile(
USE_REQUEST_COMPRESSION_ENV_VAR,
Aws::String disableCompressionConfig = clientConfig.LoadConfigFromEnvOrProfile(
DISABLE_REQUEST_COMPRESSION_ENV_VAR,
Aws::Auth::GetConfigProfileName(),
USE_REQUEST_COMPRESSION_CONFIG_VAR,
{"ENABLE", "DISABLE", "enable", "disable"},
"ENABLE"
DISABLE_REQUEST_COMPRESSION_CONFIG_VAR,
{"TRUE", "FALSE", "true", "false"},
"false"
);

if (Aws::Utils::StringUtils::ToLower(useCompressionConfig.c_str()) == "disable") {
if (Aws::Utils::StringUtils::ToLower(disableCompressionConfig.c_str()) == "true") {
clientConfig.requestCompressionConfig.useRequestCompression = Aws::Client::UseRequestCompression::DISABLE;
AWS_LOGSTREAM_DEBUG(CLIENT_CONFIG_TAG, "Request Compression disabled");
} else {
Expand Down

0 comments on commit 5b6ad60

Please sign in to comment.