Merge pull request #950 from harshavardhana/pr_out_support_virtual_host_styled_requests_convert_them_to_path_style_properly
This commit is contained in:
@@ -61,6 +61,13 @@ func New(config *Config) (client.Client, error) {
|
||||
if err != nil {
|
||||
return nil, iodine.New(err, nil)
|
||||
}
|
||||
// convert any virtual host styled requests
|
||||
match, _ := filepath.Match("*.s3*.amazonaws.com", u.Host)
|
||||
if match {
|
||||
hostSplits := strings.SplitN(u.Host, ".", 2)
|
||||
u.Path = hostSplits[0]
|
||||
u.Host = hostSplits[1]
|
||||
}
|
||||
var transport http.RoundTripper
|
||||
switch {
|
||||
case config.Debug == true:
|
||||
|
||||
Reference in New Issue
Block a user