fix #862 lost replay uri

This commit is contained in:
Sean Chen
2020-12-08 13:37:34 +08:00
committed by GitHub
parent d677218053
commit 8e110cee7b
+5 -3
View File
@@ -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
}