Add User-Agent header with MinIO release details in http logs (#7843)

This would allow http log target server to distinguish between log
messages across different versions of MinIO deployments.
This commit is contained in:
Krishnan Parthasarathi
2019-08-14 11:43:43 -07:00
committed by Harshavardhana
parent 1cd801b2e9
commit bbb56739bd
7 changed files with 53 additions and 13 deletions

View File

@@ -500,5 +500,25 @@ func TestLCP(t *testing.T) {
t.Fatalf("Test %d: Common prefix found: `%v`, expected: `%v`", i+1, foundPrefix, test.commonPrefix)
}
}
}
func TestGetMinioMode(t *testing.T) {
testMinioMode := func(expected string) {
if mode := getMinioMode(); mode != expected {
t.Fatalf("Expected %s got %s", expected, mode)
}
}
globalIsDistXL = true
testMinioMode(globalMinioModeDistXL)
globalIsDistXL = false
globalIsXL = true
testMinioMode(globalMinioModeXL)
globalIsDistXL, globalIsXL = false, false
testMinioMode(globalMinioModeFS)
globalIsGateway, globalGatewayName = true, "azure"
testMinioMode(globalMinioModeGatewayPrefix + globalGatewayName)
}