From d86973dcca2634a1c6638d87cc3f69587ed4e8ef Mon Sep 17 00:00:00 2001 From: Remco Verhoef Date: Mon, 8 May 2017 14:40:27 -0700 Subject: [PATCH] Allow bucket creation in different regions, closes #4287 and #4241 * I needed to remove the region check from PutBucketHandler --- cmd/gateway-gcs.go | 5 ----- cmd/gateway-handlers.go | 9 --------- 2 files changed, 14 deletions(-) diff --git a/cmd/gateway-gcs.go b/cmd/gateway-gcs.go index bcace2241..f0acb7897 100644 --- a/cmd/gateway-gcs.go +++ b/cmd/gateway-gcs.go @@ -229,11 +229,6 @@ func (l *gcsGateway) MakeBucket(bucket string) error { func (l *gcsGateway) MakeBucketWithLocation(bucket, location string) error { bkt := l.client.Bucket(bucket) - // we'll default to the us multi-region in case of us-east-1 - if location == "us-east-1" { - location = "us" - } - if err := bkt.Create(l.ctx, l.projectID, &storage.BucketAttrs{ Location: location, }); err != nil { diff --git a/cmd/gateway-handlers.go b/cmd/gateway-handlers.go index 081ab1bf9..9d9974a7c 100644 --- a/cmd/gateway-handlers.go +++ b/cmd/gateway-handlers.go @@ -653,15 +653,6 @@ func (api gatewayAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Re return } - // validating region here, because isValidLocationConstraint - // reads body which has been read already. So only validating - // region here. - serverRegion := serverConfig.GetRegion() - if serverRegion != "" && serverRegion != location { - writeErrorResponse(w, ErrInvalidRegion, r.URL) - return - } - bucketLock := globalNSMutex.NewNSLock(bucket, "") bucketLock.Lock() defer bucketLock.Unlock()