Selaa lähdekoodia

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
XueBing 8 vuotta sitten
vanhempi
commit
a44be1e2ed
2 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 2 0
      src/models/server/config.go
  2. 2 2
      src/utils/vhost/router.go

+ 2 - 0
src/models/server/config.go

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

+ 2 - 2
src/utils/vhost/router.go

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