fix: rename error message for MINIO_BROWSER_REDIRECT_URL (#12700)

rename the error message for MINIO_BROWSER_REDIRECT_URL to match the field name
This commit is contained in:
Lazzaretti 2021-07-14 21:38:25 +02:00 committed by GitHub
parent b8f95fb3d4
commit e8cbfa7af2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -419,14 +419,14 @@ func handleCommonEnvVars() {
if redirectURL := env.Get(config.EnvMinIOBrowserRedirectURL, ""); redirectURL != "" {
u, err := xnet.ParseHTTPURL(redirectURL)
if err != nil {
logger.Fatal(err, "Invalid MINIO_BROWSER_REDIRECT value in environment variable")
logger.Fatal(err, "Invalid MINIO_BROWSER_REDIRECT_URL value in environment variable")
}
// Look for if URL has invalid values and return error.
if !((u.Scheme == "http" || u.Scheme == "https") &&
(u.Path == "/" || u.Path == "") && u.Opaque == "" &&
!u.ForceQuery && u.RawQuery == "" && u.Fragment == "") {
err := fmt.Errorf("URL contains unexpected resources, expected URL to be of http(s)://minio.example.com format: %v", u)
logger.Fatal(err, "Invalid MINIO_BROWSER_REDIRECT value is environment variable")
logger.Fatal(err, "Invalid MINIO_BROWSER_REDIRECT_URL value is environment variable")
}
u.Path = "" // remove any path component such as `/`
globalBrowserRedirectURL = u