diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 1a4983790..0604ca94d 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -552,7 +552,7 @@ func addCustomHeaders(h http.Handler) http.Handler { // Set custom headers such as x-amz-request-id for each request. w.Header().Set(xhttp.AmzRequestID, mustGetRequestID(UTCNow())) if globalLocalNodeName != "" { - w.Header().Set(xhttp.AmzRequestNodeID, globalLocalNodeName) + w.Header().Set(xhttp.AmzRequestNodeID, globalLocalNodeNameHex) } h.ServeHTTP(xhttp.NewResponseRecorder(w), r) }) diff --git a/cmd/globals.go b/cmd/globals.go index a88b429f1..909d61850 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -233,7 +233,8 @@ var ( globalEndpoints EndpointServerPools // The name of this local node, fetched from arguments - globalLocalNodeName string + globalLocalNodeName string + globalLocalNodeNameHex string // The global subnet config globalSubnetConfig subnet.Config diff --git a/cmd/server-main.go b/cmd/server-main.go index ca24809db..9fc2d4fc4 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -19,6 +19,7 @@ package cmd import ( "context" + "encoding/hex" "errors" "fmt" "io" @@ -42,6 +43,7 @@ import ( "github.com/minio/minio/internal/bucket/bandwidth" "github.com/minio/minio/internal/color" "github.com/minio/minio/internal/config" + "github.com/minio/minio/internal/hash/sha256" xhttp "github.com/minio/minio/internal/http" "github.com/minio/minio/internal/logger" "github.com/minio/pkg/certs" @@ -221,6 +223,8 @@ func serverHandleCmdArgs(ctx *cli.Context) { logger.FatalIf(err, "Invalid command line arguments") globalLocalNodeName = GetLocalPeer(globalEndpoints, globalMinioHost, globalMinioPort) + nodeNameSum := sha256.Sum256([]byte(globalLocalNodeNameHex)) + globalLocalNodeNameHex = hex.EncodeToString(nodeNameSum[:]) globalRemoteEndpoints = make(map[string]Endpoint) for _, z := range globalEndpoints {