瀏覽代碼

auto update script executed

Toby Chui 1 年之前
父節點
當前提交
57606bea09
共有 1 個文件被更改,包括 10 次插入11 次删除
  1. 10 11
      mod/dynamicproxy/dpcore/dpcore.go

+ 10 - 11
mod/dynamicproxy/dpcore/dpcore.go

@@ -74,17 +74,16 @@ func NewDynamicProxyCore(target *url.URL, prepender string) *ReverseProxy {
 	targetQuery := target.RawQuery
 	director := func(req *http.Request) {
 		fmt.Println(target.Host, target.Path, req.URL.Path)
-		/*
-			req.URL.Scheme = target.Scheme
-			req.URL.Host = target.Host
-			req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
-
-			// If Host is empty, the Request.Write method uses
-			// the value of URL.Host.
-			// force use URL.Host
-			req.Host = req.URL.Host
-		*/
-		req.Host = "imuslab.com"
+
+		req.URL.Scheme = target.Scheme
+		req.URL.Host = target.Host
+		req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
+
+		// If Host is empty, the Request.Write method uses
+		// the value of URL.Host.
+		// force use URL.Host
+		//req.Host = req.URL.Host
+
 		if targetQuery == "" || req.URL.RawQuery == "" {
 			req.URL.RawQuery = targetQuery + req.URL.RawQuery
 		} else {