Send deployment id and minio version in http header (#14378)

This commit is contained in:
Shireesh Anjal
2022-02-24 03:06:01 +05:30
committed by GitHub
parent 27f64dd9a4
commit 25144fedd5
7 changed files with 34 additions and 12 deletions

View File

@@ -191,3 +191,9 @@ const (
UploadID = "uploadId"
)
// http headers sent to webhook targets
const (
// Reports the version of MinIO server
MinIOVersion = "x-minio-version"
)

View File

@@ -33,6 +33,14 @@ import (
humanize "github.com/dustin/go-humanize"
)
var (
// GlobalMinIOVersion - is sent in the header to all http targets
GlobalMinIOVersion string
// GlobalDeploymentID - is sent in the header to all http targets
GlobalDeploymentID string
)
const (
serverShutdownPoll = 500 * time.Millisecond
@@ -196,3 +204,13 @@ func NewServer(addrs []string) *Server {
httpServer.MaxHeaderBytes = DefaultMaxHeaderBytes
return httpServer
}
// SetMinIOVersion -- MinIO version from the main package is set here
func SetMinIOVersion(minioVer string) {
GlobalMinIOVersion = minioVer
}
// SetDeploymentID -- Deployment Id from the main package is set here
func SetDeploymentID(deploymentID string) {
GlobalDeploymentID = deploymentID
}