set default location empty string array

modified:   src/models/server/config.go
	modified:   src/utils/vhost/router.go

	modified:   src/models/server/config.go
	modified:   src/utils/vhost/router.go
This commit is contained in:
XueBing 2016-12-19 10:34:37 +08:00 committed by xuebing1
parent a4c05e6ff9
commit a44be1e2ed
2 changed files with 4 additions and 2 deletions

View File

@ -301,6 +301,8 @@ func loadProxyConf(confFile string) (proxyServers map[string]*ProxyServer, err e
locStr, loc_ok := section["custom_location"] locStr, loc_ok := section["custom_location"]
if loc_ok { if loc_ok {
proxyServer.Locations = strings.Split(locStr, ",") proxyServer.Locations = strings.Split(locStr, ",")
} else {
proxyServer.Locations = []string{""}
} }
} else if proxyServer.Type == "https" { } else if proxyServer.Type == "https" {
// for https // for https

View File

@ -91,8 +91,8 @@ func (r *VhostRouters) get(rname string) (vr *VhostRouter, exist bool) {
url = tmparray[1] url = tmparray[1]
} }
vrs, exist := r.RouterByDomain[domain] vrs, found := r.RouterByDomain[domain]
if !exist { if !found {
return return
} }