From 8e110cee7bbf509ac76bcdd4a300ac585a48aad5 Mon Sep 17 00:00:00 2001 From: Sean Chen <40845434+two@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:37:34 +0800 Subject: [PATCH] fix #862 lost replay uri --- output_http.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/output_http.go b/output_http.go index ee4d7eb..e7c8dcf 100644 --- a/output_http.go +++ b/output_http.go @@ -300,9 +300,11 @@ func (c *HTTPClient) Send(data []byte) ([]byte, error) { if !c.config.OriginalHost { req.Host = c.config.url.Host } - - if c.config.url.Path == "" { - req.URL, _ = url.ParseRequestURI(c.config.url.Scheme + "://" + c.config.url.Host + req.RequestURI) + + // fix #862 + if c.config.url.Path == "" && c.config.url.RawQuery == "" { + req.URL.Scheme = c.config.url.Scheme + req.URL.Host = c.config.url.Host } else { req.URL = c.config.url }