Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
73c63733ee
1 changed files with 5 additions and 7 deletions
  1. 5 7
      mod/dynamicproxy/dpcore/dpcore.go

+ 5 - 7
mod/dynamicproxy/dpcore/dpcore.go

@@ -240,7 +240,6 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
 		transport = http.DefaultTransport
 	}
 
-	fmt.Println("CHECKPOINT1", req.URL)
 	outreq := new(http.Request)
 	// Shallow copies of maps, like header
 	*outreq = *req
@@ -262,22 +261,22 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
 			}()
 		}
 	}
-	fmt.Println("CHECKPOINT2", req.URL)
 
+	fmt.Println("CHECKPOINT1", req.URL)
 	p.Director(outreq)
 	outreq.Close = false
-
+	fmt.Println("CHECKPOINT2", req.URL)
 	// We may modify the header (shallow copied above), so we only copy it.
 	outreq.Header = make(http.Header)
 	copyHeader(outreq.Header, req.Header)
-
+	fmt.Println("CHECKPOINT3", req.URL)
 	// Remove hop-by-hop headers listed in the "Connection" header, Remove hop-by-hop headers.
 	removeHeaders(outreq.Header)
-
+	fmt.Println("CHECKPOINT4", req.URL)
 	// Add X-Forwarded-For Header.
 	addXForwardedForHeader(outreq)
+	fmt.Println("CHECKPOINT5", req.URL)
 
-	fmt.Println("CHECKPOINT3", req.URL)
 	res, err := transport.RoundTrip(outreq)
 	if err != nil {
 		if p.Verbal {
@@ -301,7 +300,6 @@ func (p *ReverseProxy) ProxyHTTP(rw http.ResponseWriter, req *http.Request, rrr
 			return err
 		}
 	}
-	fmt.Println("CHECKPOINT4", req.URL)
 
 	//Custom header rewriter functions
 	if res.Header.Get("Location") != "" {