From be62757efa880297ff474e1033056734148d3723 Mon Sep 17 00:00:00 2001 From: Gianluca Date: Thu, 2 May 2019 18:25:19 +0200 Subject: [PATCH] fix: http proxy modules couldn't handle properly requests with port number in the URL. --- modules/http_proxy/http_proxy_js_request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/http_proxy/http_proxy_js_request.go b/modules/http_proxy/http_proxy_js_request.go index ea6454a0..f90a0885 100644 --- a/modules/http_proxy/http_proxy_js_request.go +++ b/modules/http_proxy/http_proxy_js_request.go @@ -172,7 +172,7 @@ func (j *JSRequest) ParseForm() map[string]string { } func (j *JSRequest) ToRequest() (req *http.Request) { - url := fmt.Sprintf("%s://%s:%s%s?%s", j.Scheme, j.Hostname, j.req.URL.Port(), j.Path, j.Query) + url := fmt.Sprintf("%s://%s:%s%s?%s", j.Scheme, j.req.URL.Hostname(), j.req.URL.Port(), j.Path, j.Query) if j.Body == "" { req, _ = http.NewRequest(j.Method, url, j.req.Body) } else {