Merge pull request #264 from harshavardhana/api-put

putBucket: Make bucket request should not use location constraint.
This commit is contained in:
Krishna Srinivas 2015-12-14 12:45:16 +05:30
commit 2142093176
1 changed files with 6 additions and 5 deletions

View File

@ -32,10 +32,6 @@ func (a API) MakeBucket(bucketName string, acl BucketACL, region string) error {
return ErrInvalidArgument("Unrecognized ACL " + acl.String())
}
if region == "" {
region = "us-east-1"
}
req, err := a.makeBucketRequest(bucketName, string(acl), region)
if err != nil {
return err
@ -70,10 +66,15 @@ func (a API) makeBucketRequest(bucketName, acl, region string) (*Request, error)
reqMetadata = requestMetadata{
userAgent: a.userAgent,
credentials: a.credentials,
bucketRegion: region,
bucketRegion: "us-east-1",
contentTransport: a.httpTransport,
}
// if region is 'us-east-1' no need to apply location constraint on the bucket.
if region == "us-east-1" {
region = ""
}
// If region is set use to create bucket location config.
if region != "" {
createBucketConfig := new(createBucketConfiguration)