Autocorrect user provided Azure endpoint (#5417)

fixes #5373
This commit is contained in:
Krishna Srinivas 2018-01-29 10:30:08 -08:00 committed by kannappanr
parent 09a9002f12
commit 45c35b3544

View File

@ -130,6 +130,10 @@ func (g *Azure) NewGatewayLayer(creds auth.Credentials) (minio.GatewayLayer, err
}
}
if endpoint == fmt.Sprintf("%s.blob.%s", creds.AccessKey, storage.DefaultBaseURL) {
// If, by mistake, user provides endpoint as accountname.blob.core.windows.net
endpoint = storage.DefaultBaseURL
}
c, err := storage.NewClient(creds.AccessKey, creds.SecretKey, endpoint, globalAzureAPIVersion, secure)
if err != nil {
return &azureObjects{}, err