Przeglądaj źródła

fix panic error when vhost_http_port is not set but there is a http
proxy, fix #776

fatedier 6 lat temu
rodzic
commit
ad1e32fd2d
2 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 1
      models/config/proxy.go
  2. 0 1
      utils/vhost/newhttp.go

+ 1 - 1
models/config/proxy.go

@@ -509,7 +509,7 @@ func (cfg *HttpProxyConf) CheckForCli() (err error) {
 
 func (cfg *HttpProxyConf) CheckForSvr() (err error) {
 	if vhostHttpPort == 0 {
-		err = fmt.Errorf("type [http] not support when vhost_http_port is not set")
+		return fmt.Errorf("type [http] not support when vhost_http_port is not set")
 	}
 	if err = cfg.DomainConf.checkForSvr(); err != nil {
 		err = fmt.Errorf("proxy [%s] domain conf check error: %v", cfg.ProxyName, err)

+ 0 - 1
utils/vhost/newhttp.go

@@ -49,7 +49,6 @@ func getHostFromAddr(addr string) (host string) {
 
 type HttpReverseProxy struct {
 	proxy *ReverseProxy
-	tr    *http.Transport
 
 	vhostRouter *VhostRouters