handler: simplify parsing valid location constraint. (#4040)

Separate out validating v/s parsing logic in
isValidLocationConstraint() into parseLocationConstraint()
and isValidLocation()

Additionally also set `X-Amz-Bucket-Region` as part of the
common headers for the clients to fallback on in-case of any
region related errors.
This commit is contained in:
Harshavardhana
2017-04-03 14:50:09 -07:00
committed by GitHub
parent 4041e5f20d
commit 3fe33e7b15
5 changed files with 35 additions and 31 deletions
+5
View File
@@ -1346,6 +1346,11 @@ func TestToAdminAPIErr(t *testing.T) {
}
func TestWriteSetConfigResponse(t *testing.T) {
rootPath, err := newTestConfig(globalMinioDefaultRegion)
if err != nil {
t.Fatal(err)
}
defer removeAll(rootPath)
testCases := []struct {
status bool
errs []error