File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -697,17 +697,14 @@ S3CredentialsProviderChain::S3CredentialsProviderChain(
697
697
698
698
if (!credentials_configuration.sts_endpoint_override .empty ())
699
699
{
700
- const String & new_endpoint = Poco::toLower (credentials_configuration.sts_endpoint_override );
701
- if (new_endpoint.starts_with (" https" ))
702
- {
703
- sts_client_config.scheme = Aws::Http::Scheme::HTTPS;
704
- sts_client_config.endpointOverride = new_endpoint.substr (8 );
705
- }
706
- else
707
- {
708
- sts_client_config.scheme = Aws::Http::Scheme::HTTP;
709
- sts_client_config.endpointOverride = new_endpoint.substr (7 );
710
- }
700
+ auto endpoint_uri = Poco::URI (credentials_configuration.sts_endpoint_override );
701
+
702
+ String url_without_scheme = endpoint_uri.getHost ();
703
+ if (endpoint_uri.getPort () != 0 )
704
+ url_without_scheme += " :" + std::to_string (endpoint_uri.getPort ());
705
+
706
+ sts_client_config.endpointOverride = url_without_scheme;
707
+ sts_client_config.scheme = endpoint_uri.getScheme () == " https" ? Aws::Http::Scheme::HTTPS : Aws::Http::Scheme::HTTP;
711
708
}
712
709
713
710
AddProvider (std::make_shared<Aws::Auth::STSAssumeRoleCredentialsProvider>(
You can’t perform that action at this time.
0 commit comments