From 8b7df7da3742bdb6e62585cc5a7f0b2725fe19d2 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 23 Jun 2017 16:05:40 -0700 Subject: [PATCH] api: No need to set x-amz-bucket-region if region is empty. (#4586) --- cmd/api-headers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/api-headers.go b/cmd/api-headers.go index 9e510084b..94a5ebb2e 100644 --- a/cmd/api-headers.go +++ b/cmd/api-headers.go @@ -36,7 +36,11 @@ 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()) + // Set `x-amz-bucket-region` only if region is set on the server + // by default minio uses an empty region. + if region := serverConfig.GetRegion(); region != "" { + w.Header().Set("X-Amz-Bucket-Region", region) + } w.Header().Set("Accept-Ranges", "bytes") }