From a69f74533cc530cbc62a576f2940062ba27b42aa Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 5 Jun 2019 16:28:21 -0700 Subject: [PATCH] Add region as part of error XML (#7752) --- Makefile | 5 ++++- cmd/api-errors.go | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 65edfe3fa..1972c69ed 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,10 @@ GOPATH := $(shell go env GOPATH) LDFLAGS := $(shell go run buildscripts/gen-ldflags.go) GOOS := $(shell go env GOOS) -GOOSALT := $(shell if [ ${GOOS} == 'darwin' ]; then echo 'mac'; else echo ${GOOS}; fi;) +GOOSALT ?= 'linux' +ifeq ($(GOOS),'darwin') + GOOSALT = 'mac' +endif TAG ?= $(USER) BUILD_LDFLAGS := '$(LDFLAGS)' diff --git a/cmd/api-errors.go b/cmd/api-errors.go index df4f03e12..b57f69de1 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -51,6 +51,7 @@ type APIErrorResponse struct { Key string `xml:"Key,omitempty" json:"Key,omitempty"` BucketName string `xml:"BucketName,omitempty" json:"BucketName,omitempty"` Resource string + Region string `xml:"Region,omitempty" json:"Region,omitempty"` RequestID string `xml:"RequestId" json:"RequestId"` HostID string `xml:"HostId" json:"HostId"` } @@ -1735,6 +1736,7 @@ func getAPIErrorResponse(ctx context.Context, err APIError, resource, requestID, BucketName: reqInfo.BucketName, Key: reqInfo.ObjectName, Resource: resource, + Region: globalServerConfig.GetRegion(), RequestID: requestID, HostID: hostID, }