This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-core/source/Region.cpp

36 lines
946 B
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/Region.h>
namespace Aws
{
namespace Region
{
Aws::String ComputeSignerRegion(const Aws::String& region)
{
if (region == Aws::Region::AWS_GLOBAL)
{
return Aws::Region::US_EAST_1;
}
else if (region == "s3-external-1")
{
return Aws::Region::US_EAST_1;
}
else if (region.compare(0, 5, "fips-") == 0)
{
return region.substr(5);
}
else if (region.compare(region.size() - 5, 5, "-fips") == 0)
{
return region.substr(0, region.size() - 5);
}
else
{
return region;
}
}
}
}