mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Simplify credential usage. (#3893)
This commit is contained in:
23
cmd/utils.go
23
cmd/utils.go
@@ -29,7 +29,6 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/minio/mc/pkg/console"
|
||||
"github.com/pkg/profile"
|
||||
)
|
||||
|
||||
@@ -255,28 +254,6 @@ func dumpRequest(r *http.Request) string {
|
||||
return string(jsonBytes)
|
||||
}
|
||||
|
||||
// Variant of getBrowserFromEnv but upon error fails right here.
|
||||
func mustGetBrowserFromEnv() string {
|
||||
browser, err := getBrowserFromEnv()
|
||||
if err != nil {
|
||||
console.Fatalf("Unable to load MINIO_BROWSER value from environment. Err: %s.\n", err)
|
||||
}
|
||||
return browser
|
||||
}
|
||||
|
||||
//
|
||||
func getBrowserFromEnv() (string, error) {
|
||||
b := os.Getenv("MINIO_BROWSER")
|
||||
if strings.TrimSpace(b) == "" {
|
||||
return "", nil
|
||||
}
|
||||
if !strings.EqualFold(b, "off") && !strings.EqualFold(b, "on") {
|
||||
return "", errInvalidArgument
|
||||
}
|
||||
globalIsEnvBrowser = true
|
||||
return strings.ToLower(b), nil
|
||||
}
|
||||
|
||||
// isFile - returns whether given path is a file or not.
|
||||
func isFile(path string) bool {
|
||||
if fi, err := os.Stat(path); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user