Add localhost and 127.0.0.1 entries into config.json

This commit is contained in:
Harshavardhana
2015-07-23 10:46:13 -07:00
parent d7f6bd1f4e
commit 9f4e87339c
2 changed files with 11 additions and 13 deletions
+10 -4
View File
@@ -190,6 +190,11 @@ func newConfig() (config quick.Config, err error) {
s3HostConf.AccessKeyID = globalAccessKeyID
s3HostConf.SecretAccessKey = globalSecretAccessKey
// Your example host config
exampleHostConf := new(hostConfig)
exampleHostConf.AccessKeyID = globalAccessKeyID
exampleHostConf.SecretAccessKey = globalSecretAccessKey
playHostConfig := new(hostConfig)
playHostConfig.AccessKeyID = ""
playHostConfig.SecretAccessKey = ""
@@ -198,12 +203,13 @@ func newConfig() (config quick.Config, err error) {
dlHostConfig.AccessKeyID = ""
dlHostConfig.SecretAccessKey = ""
// Your example host config
exampleHostConf := new(hostConfig)
exampleHostConf.AccessKeyID = globalAccessKeyID
exampleHostConf.SecretAccessKey = globalSecretAccessKey
localHostConfig := new(hostConfig)
localHostConfig.AccessKeyID = ""
localHostConfig.SecretAccessKey = ""
conf.Hosts[exampleHostURL] = exampleHostConf
conf.Hosts["localhost:*"] = localHostConfig
conf.Hosts["127.0.0.1:*"] = localHostConfig
conf.Hosts["s3*.amazonaws.com"] = s3HostConf
conf.Hosts["play.minio.io:9000"] = playHostConfig
conf.Hosts["dl.minio.io:9000"] = dlHostConfig
+1 -9
View File
@@ -18,7 +18,6 @@ package main
import (
"path/filepath"
"strings"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
@@ -48,14 +47,7 @@ func getHostConfig(URL string) (*hostConfig, error) {
}
return hostCfg, nil
}
// No host matching or keys needed for 127.0.0.1 URL's skip them
if strings.Contains(url.Host, "127.0.0.1") {
hostCfg := &hostConfig{
AccessKeyID: "",
SecretAccessKey: "",
}
return hostCfg, nil
}
for globURL, hostCfg := range config.Hosts {
match, err := filepath.Match(globURL, url.Host)
if err != nil {