Jelajahi Sumber

auto update script executed

Toby Chui 1 tahun lalu
induk
melakukan
7b0216b8f8
1 mengubah file dengan 6 tambahan dan 1 penghapusan
  1. 6 1
      mod/dynamicproxy/dpcore/dpcore.go

+ 6 - 1
mod/dynamicproxy/dpcore/dpcore.go

@@ -306,7 +306,12 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
 
 
 	p.Director(outreq)
 	p.Director(outreq)
 	outreq.Close = false
 	outreq.Close = false
-	outreq.Host = rrr.OriginalHost
+
+	if !rrr.UseTLS {
+		//This seems to be routing to external sites
+		//Do not keep the original host
+		outreq.Host = rrr.OriginalHost
+	}
 
 
 	// We may modify the header (shallow copied above), so we only copy it.
 	// We may modify the header (shallow copied above), so we only copy it.
 	outreq.Header = make(http.Header)
 	outreq.Header = make(http.Header)