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

View File

@@ -36,6 +36,7 @@ func setCommonHeaders(w http.ResponseWriter) {
// Set unique request ID for each reply.
w.Header().Set(responseRequestIDKey, mustGetRequestID(UTCNow()))
w.Header().Set("Server", globalServerUserAgent)
w.Header().Set("X-Amz-Bucket-Region", serverConfig.GetRegion())
w.Header().Set("Accept-Ranges", "bytes")
}