Checking updates should send a proper user-agent.

This commit is contained in:
Harshavardhana
2016-10-13 20:52:09 -07:00
parent 29a2ffef5d
commit 8c59a41668
2 changed files with 86 additions and 52 deletions
+6 -2
View File
@@ -21,6 +21,7 @@ import (
"os"
"sort"
"strings"
"time"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
@@ -167,13 +168,16 @@ func Main() {
// Do not print update messages, if quiet flag is set.
if !globalQuiet {
if strings.HasPrefix(ReleaseTag, "RELEASE.") && c.Args().Get(0) != "update" {
updateMsg := getReleaseUpdate(minioUpdateStableURL, true)
updateMsg, _, err := getReleaseUpdate(minioUpdateStableURL, time.Second*1)
if err != nil {
// Ignore all network related errors.
return nil
}
if updateMsg.Update {
console.Println(updateMsg)
}
}
}
return nil
}