add x-amz-id-2 to indicate the node that received the request (#16474)

This commit is contained in:
Harshavardhana 2023-01-25 22:44:10 +05:30 committed by GitHub
parent 0a0416b6ea
commit 65c104a589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -551,6 +551,9 @@ func addCustomHeaders(h http.Handler) http.Handler {
// part of the log entry, Error response XML and auditing.
// 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)
}
h.ServeHTTP(xhttp.NewResponseRecorder(w), r)
})
}

View File

@ -145,7 +145,8 @@ const (
AmzAccessKeyID = "AWSAccessKeyId"
// Response request id.
AmzRequestID = "x-amz-request-id"
AmzRequestID = "x-amz-request-id"
AmzRequestNodeID = "x-amz-id-2"
// Deployment id.
MinioDeploymentID = "x-minio-deployment-id"