Przeglądaj źródła

fix route conflict

fatedier 6 lat temu
rodzic
commit
74a8752570
2 zmienionych plików z 8 dodań i 0 usunięć
  1. 4 0
      server/proxy/http.go
  2. 4 0
      server/proxy/https.go

+ 4 - 0
server/proxy/http.go

@@ -51,6 +51,10 @@ func (pxy *HttpProxy) Run() (remoteAddr string, err error) {
 
 	addrs := make([]string, 0)
 	for _, domain := range pxy.cfg.CustomDomains {
+		if domain == "" {
+			continue
+		}
+
 		routeConfig.Domain = domain
 		for _, location := range locations {
 			routeConfig.Location = location

+ 4 - 0
server/proxy/https.go

@@ -33,6 +33,10 @@ func (pxy *HttpsProxy) Run() (remoteAddr string, err error) {
 
 	addrs := make([]string, 0)
 	for _, domain := range pxy.cfg.CustomDomains {
+		if domain == "" {
+			continue
+		}
+
 		routeConfig.Domain = domain
 		l, errRet := pxy.rc.VhostHttpsMuxer.Listen(routeConfig)
 		if errRet != nil {