You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/09/14 14:59:31 UTC
[GitHub] [arrow] pitrou commented on a change in pull request #8185: ARROW-9859: [C++] Decode username and password in URIs
pitrou commented on a change in pull request #8185:
URL: https://github.com/apache/arrow/pull/8185#discussion_r488000166
##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -271,17 +271,16 @@ Result<S3Options> S3Options::FromUri(const Uri& uri, std::string* out_path) {
options.ConfigureDefaultCredentials();
}
- auto it = options_map.find("region");
- if (it != options_map.end()) {
- options.region = it->second;
- }
- it = options_map.find("scheme");
- if (it != options_map.end()) {
- options.scheme = it->second;
- }
- it = options_map.find("endpoint_override");
- if (it != options_map.end()) {
- options.endpoint_override = it->second;
+ for (const auto& kv : options_map) {
+ if (kv.first == "region") {
+ options.region = kv.second;
+ } else if (kv.first == "scheme") {
+ options.scheme = kv.second;
+ } else if (kv.first == "endpoint_override") {
+ options.endpoint_override = kv.second;
+ } else {
+ return Status::Invalid("Unexpected option in S3 URI: '", kv.first, "'");
Review comment:
Thanks, will do.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org