Make sure to preserve region specific URLs (#2791)

This is to ensure that restricted access
to certain buckets is allowed on certain
regions.

This is a continuation of last commit
This commit is contained in:
Harshavardhana
2019-06-11 13:59:10 -07:00
committed by kannappanr
parent b85dabd6b4
commit 5d0a9c0803
-6
View File
@@ -53,7 +53,6 @@ type s3Client struct {
}
const (
amazonHostName = "s3.amazonaws.com"
amazonHostNameAccelerated = "s3-accelerate.amazonaws.com"
googleHostName = "storage.googleapis.com"
@@ -109,11 +108,6 @@ func newFactory() func(config *Config) (Client, *probe.Error) {
isS3AcceleratedEndpoint := isAmazonAccelerated(hostName)
if s3Clnt.virtualStyle {
// If Amazon URL replace it with 's3.amazonaws.com'
if isAmazon(hostName) || isAmazonAccelerated(hostName) {
hostName = amazonHostName
}
// If Google URL replace it with 'storage.googleapis.com'
if isGoogle(hostName) {
hostName = googleHostName