Add region to gcs gateway example

This commit is contained in:
Remco Verhoef
2017-05-10 16:53:44 -07:00
committed by Harshavardhana
parent 5c78415b31
commit 4430085981
2 changed files with 25 additions and 2 deletions

View File

@@ -658,7 +658,10 @@ func (api gatewayAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Re
// reads body which has been read already. So only validating
// region here.
serverRegion := serverConfig.GetRegion()
if serverRegion != location {
if serverRegion == "" {
// we will only validate the region
// when the region has been explicitely set
} else if serverRegion != location {
writeErrorResponse(w, ErrInvalidRegion, r.URL)
return
}