File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,14 @@ inline string readAWSS3(string path, string range) {
388388 else if (const char * env_p = std::getenv (" AWS_ENDPOINT_URL_S3" )) {
389389 clientConfig.endpointOverride = env_p;
390390 }
391- auto client = Aws::S3::S3Client (clientConfig);
391+
392+ bool usePathStyle = false ; // Default to virtual-style addressing
393+ if (const char * env_p = std::getenv (" AWS_USE_PATH_STYLE" )) {
394+ std::string env_value (env_p);
395+ usePathStyle = (env_value == " true" || env_value == " 1" );
396+ }
397+
398+ auto client = Aws::S3::S3Client (clientConfig, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, !usePathStyle);
392399 auto request = Aws::S3::Model::GetObjectRequest ();
393400 request.SetBucket (bucket.c_str ());
394401 request.SetKey (key.c_str ());
You can’t perform that action at this time.
0 commit comments