Use MINIO_REGION environment variable for region configuration, closes #4287

This commit is contained in:
Remco Verhoef
2017-05-10 10:02:45 -07:00
committed by Harshavardhana
parent dd7e47f264
commit 2de1921fe8
2 changed files with 15 additions and 25 deletions

View File

@@ -652,6 +652,15 @@ 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 != location {
writeErrorResponse(w, ErrInvalidRegion, r.URL)
return
}
bucketLock := globalNSMutex.NewNSLock(bucket, "")
bucketLock.Lock()
defer bucketLock.Unlock()