mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
config: Check for duplicated entries in all scopes (#3872)
Validate Minio config by checking if there is double json key in any scope level. The returned error contains the json path to the duplicated key.
This commit is contained in:
committed by
Harshavardhana
parent
cad0d0eb7a
commit
ae4361cc45
13
cmd/utils.go
13
cmd/utils.go
@@ -285,3 +285,16 @@ func isFile(path string) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// checkNetURL - checks if passed address correspond
|
||||
// to a network address (and not file system path)
|
||||
func checkNetURL(address string) (*url.URL, error) {
|
||||
u, err := url.Parse(address)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("`%s` invalid: %s", address, err.Error())
|
||||
}
|
||||
if u.Host == "" {
|
||||
return nil, fmt.Errorf("`%s` invalid network URL", address)
|
||||
}
|
||||
return u, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user