Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d43c1d

Browse files
author
Marco Magdy
committed
Skip Virtual-Addressing when bucket name contains uppercase letters.
1 parent 25c2ef6 commit 3d43c1d

File tree

1 file changed

+5
-1
lines changed
  • code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3

1 file changed

+5
-1
lines changed

code-generation/generator/src/main/resources/com/amazonaws/util/awsclientgenerator/velocity/cpp/s3/S3ClientSource.vm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ Aws::String ${className}::GeneratePresignedUrl(const Aws::String& bucketName, co
1414
Aws::String ${className}::ComputeEndpointString(const Aws::String& bucket) const
1515
{
1616
Aws::StringStream ss;
17-
if(m_useVirtualAdressing && Aws::Utils::IsValidDnsLabel(bucket))
17+
// when using virtual hosting of buckets, the bucket name has to follow some rules.
18+
// Mainly, it has to be a valid DNS label, and it must be lowercase.
19+
// For more information see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket
20+
if(m_useVirtualAdressing && Aws::Utils::IsValidDnsLabel(bucket) &&
21+
bucket == Aws::Utils::StringUtils::ToLower(bucket.c_str()))
1822
{
1923
ss << m_scheme << "://" << bucket << "." << m_baseUri;
2024
}

0 commit comments

Comments
 (0)