Skip to content

Commit

Permalink
use req.Host instead of URL.Host
Browse files Browse the repository at this point in the history
  • Loading branch information
ruckc committed Dec 19, 2022
1 parent be6671b commit d4f24ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/goproxygo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func reverseProxyHandler(destination *url.URL) *httputil.ReverseProxy {
proxy.Director = func(req *http.Request) {
req.Header.Set("Origin", fmt.Sprintf("%s://%s", destination.Scheme, destination.Host))
req.Header.Set("X-Forwarded-Proto", req.URL.Scheme)
req.Header.Set("Host", req.URL.Host)
req.Header.Set("Host", req.Host)
req.Host = req.URL.Host
req.URL.Scheme = destination.Scheme
req.URL.Host = destination.Host
Expand Down

0 comments on commit d4f24ed

Please sign in to comment.