Merge pull request #1482 from harshavardhana/milkway

region: minio server and minio-go now honor 'us-east-1' as default re…
This commit is contained in:
Harshavardhana
2015-11-23 14:14:10 -08:00
3 changed files with 11 additions and 19 deletions
+8 -16
View File
@@ -104,8 +104,7 @@ func getRegion(host string) (region string) {
return regions[host]
}
// Region cannot be empty according to Amazon S3 for AWS Signature Version 4.
// So we will in-turn address all the four quadrants of our galaxy.
return "milkyway"
return "us-east-1"
}
// getEndpoint returns a endpoint based on its region.
@@ -642,18 +641,14 @@ func (a API) PutObject(bucket, object, contentType string, size int64, data io.R
if err := invalidArgumentError(object); err != nil {
return err
}
// for un-authenticated requests do not initiated multipart operation.
//
// NOTE: this behavior is only kept valid for S3, since S3 doesn't
// allow unauthenticated multipart requests.
if a.config.Region != "milkyway" {
if a.config.AccessKeyID == "" || a.config.SecretAccessKey == "" {
_, err := a.putObjectUnAuthenticated(bucket, object, contentType, size, data)
if err != nil {
return err
}
return nil
// for un-authenticated requests do not initiate multipart operation.
// NOTE: S3 doesn't allow unauthenticated multipart requests.
if a.config.AccessKeyID == "" || a.config.SecretAccessKey == "" {
_, err := a.putObjectUnAuthenticated(bucket, object, contentType, size, data)
if err != nil {
return err
}
return nil
}
// Special handling just for Google Cloud Storage.
// TODO - we should remove this in future when we fully implement Resumable object upload.
@@ -756,9 +751,6 @@ func (a API) MakeBucket(bucket string, acl BucketACL) error {
return invalidArgumentError("")
}
location := a.config.Region
if location == "milkyway" {
location = ""
}
if location == "us-east-1" {
location = ""
}
+1 -1
View File
@@ -68,7 +68,7 @@ func TestGetRegion(t *testing.T) {
t.Fatalf("Error")
}
region = getRegion("localhost:9000")
if region != "milkyway" {
if region != "us-east-1" {
t.Fatalf("Error")
}
}
+2 -2
View File
@@ -29,8 +29,8 @@
},
{
"path": "github.com/minio/minio-go",
"revision": "577f4282e75b8552bdf754afd8003165ee3cc14d",
"revisionTime": "2015-11-20T16:01:24-08:00"
"revision": "bf8996055bebd547d940b8579d2ec05f2d37ede8",
"revisionTime": "2015-11-23T14:07:27-08:00"
},
{
"path": "github.com/minio/minio-xl/pkg/atomic",