Bläddra i källkod

auto update script executed

Toby Chui 1 år sedan
förälder
incheckning
edac178f1d
1 ändrade filer med 8 tillägg och 12 borttagningar
  1. 8 12
      mod/dynamicproxy/dpcore/dpcore.go

+ 8 - 12
mod/dynamicproxy/dpcore/dpcore.go

@@ -302,20 +302,16 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
 		locationRewrite := res.Header.Get("Location")
 		originLocation := res.Header.Get("Location")
 		res.Header.Set("zr-origin-location", originLocation)
-		/*
-			domainWithoutPort := rrr.ProxyDomain
-			if strings.Contains(rrr.ProxyDomain, ":") {
-				//Split the port away
-				domainWithoutPort = strings.Split(rrr.ProxyDomain, ":")[0]
-			}
 
-			//Trim away the source headers if exists
+		domainWithoutPort := rrr.ProxyDomain
+		if strings.Contains(rrr.ProxyDomain, ":") {
+			//Split the port away
+			domainWithoutPort = strings.Split(rrr.ProxyDomain, ":")[0]
+		}
 
-			locationRewrite = strings.TrimPrefix(locationRewrite, "http://"+rrr.ProxyDomain)
-			locationRewrite = strings.TrimPrefix(locationRewrite, "http://"+domainWithoutPort)
-			locationRewrite = strings.TrimPrefix(locationRewrite, "https://"+rrr.ProxyDomain)
-			locationRewrite = strings.TrimPrefix(locationRewrite, "https://"+domainWithoutPort)
-		*/
+		//Trim away the source headers if exists
+		locationRewrite = strings.TrimPrefix(locationRewrite, "http://"+rrr.ProxyDomain)
+		locationRewrite = strings.TrimPrefix(locationRewrite, "http://"+domainWithoutPort)
 
 		//Custom redirection to this rproxy relative path
 		res.Header.Set("Location", locationRewrite)