Add support for req.URL.RawQuery

This commit is contained in:
sago35
2021-08-10 21:45:28 +09:00
committed by Ron Evans
parent a0119ffc6f
commit 358501fc47
+6
View File
@@ -56,6 +56,9 @@ func (c *Client) doHTTP(req *Request) (*Response, error) {
if p == "" {
p = "/"
}
if req.URL.RawQuery != "" {
p += "?" + req.URL.RawQuery
}
fmt.Fprintln(conn, req.Method+" "+p+" HTTP/1.1")
fmt.Fprintln(conn, "Host:", req.URL.Host)
@@ -114,6 +117,9 @@ func (c *Client) doHTTPS(req *Request) (*Response, error) {
if p == "" {
p = "/"
}
if req.URL.RawQuery != "" {
p += "?" + req.URL.RawQuery
}
fmt.Fprintln(conn, req.Method+" "+p+" HTTP/1.1")
fmt.Fprintln(conn, "Host:", req.URL.Host)