Merge pull request #1185 from bryceml/master

handle edge case when bucket name and first part of endpoint match
This commit is contained in:
Takeshi Nakatani 2019-10-31 23:42:47 +09:00 committed by GitHub
commit a07a5336f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4689,7 +4689,7 @@ string prepare_url(const char* url)
string path;
string url_str = string(url);
string token = string("/") + bucket;
int bucket_pos = url_str.find(token);
int bucket_pos;
int bucket_length = token.size();
int uri_length = 0;
@ -4699,6 +4699,7 @@ string prepare_url(const char* url)
uri_length = 7;
}
uri = url_str.substr(0, uri_length);
bucket_pos = url_str.find(token, uri_length);
if(!pathrequeststyle){
hostname = bucket + "." + url_str.substr(uri_length, bucket_pos - uri_length);