mirror of
https://github.com/minio/minio.git
synced 2024-12-25 14:45:54 -05:00
fix: anonymize the x-amz-id-2 value from hostname (#16478)
This commit is contained in:
parent
65c104a589
commit
54b561898f
@ -552,7 +552,7 @@ func addCustomHeaders(h http.Handler) http.Handler {
|
|||||||
// Set custom headers such as x-amz-request-id for each request.
|
// Set custom headers such as x-amz-request-id for each request.
|
||||||
w.Header().Set(xhttp.AmzRequestID, mustGetRequestID(UTCNow()))
|
w.Header().Set(xhttp.AmzRequestID, mustGetRequestID(UTCNow()))
|
||||||
if globalLocalNodeName != "" {
|
if globalLocalNodeName != "" {
|
||||||
w.Header().Set(xhttp.AmzRequestNodeID, globalLocalNodeName)
|
w.Header().Set(xhttp.AmzRequestNodeID, globalLocalNodeNameHex)
|
||||||
}
|
}
|
||||||
h.ServeHTTP(xhttp.NewResponseRecorder(w), r)
|
h.ServeHTTP(xhttp.NewResponseRecorder(w), r)
|
||||||
})
|
})
|
||||||
|
@ -233,7 +233,8 @@ var (
|
|||||||
globalEndpoints EndpointServerPools
|
globalEndpoints EndpointServerPools
|
||||||
|
|
||||||
// The name of this local node, fetched from arguments
|
// The name of this local node, fetched from arguments
|
||||||
globalLocalNodeName string
|
globalLocalNodeName string
|
||||||
|
globalLocalNodeNameHex string
|
||||||
|
|
||||||
// The global subnet config
|
// The global subnet config
|
||||||
globalSubnetConfig subnet.Config
|
globalSubnetConfig subnet.Config
|
||||||
|
@ -19,6 +19,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@ -42,6 +43,7 @@ import (
|
|||||||
"github.com/minio/minio/internal/bucket/bandwidth"
|
"github.com/minio/minio/internal/bucket/bandwidth"
|
||||||
"github.com/minio/minio/internal/color"
|
"github.com/minio/minio/internal/color"
|
||||||
"github.com/minio/minio/internal/config"
|
"github.com/minio/minio/internal/config"
|
||||||
|
"github.com/minio/minio/internal/hash/sha256"
|
||||||
xhttp "github.com/minio/minio/internal/http"
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/minio/pkg/certs"
|
"github.com/minio/pkg/certs"
|
||||||
@ -221,6 +223,8 @@ func serverHandleCmdArgs(ctx *cli.Context) {
|
|||||||
logger.FatalIf(err, "Invalid command line arguments")
|
logger.FatalIf(err, "Invalid command line arguments")
|
||||||
|
|
||||||
globalLocalNodeName = GetLocalPeer(globalEndpoints, globalMinioHost, globalMinioPort)
|
globalLocalNodeName = GetLocalPeer(globalEndpoints, globalMinioHost, globalMinioPort)
|
||||||
|
nodeNameSum := sha256.Sum256([]byte(globalLocalNodeNameHex))
|
||||||
|
globalLocalNodeNameHex = hex.EncodeToString(nodeNameSum[:])
|
||||||
|
|
||||||
globalRemoteEndpoints = make(map[string]Endpoint)
|
globalRemoteEndpoints = make(map[string]Endpoint)
|
||||||
for _, z := range globalEndpoints {
|
for _, z := range globalEndpoints {
|
||||||
|
Loading…
Reference in New Issue
Block a user