From 358501fc47d18e7fb00919b9528981489a3ab404 Mon Sep 17 00:00:00 2001 From: sago35 Date: Tue, 10 Aug 2021 21:45:28 +0900 Subject: [PATCH] Add support for req.URL.RawQuery --- net/http/tinygo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/http/tinygo.go b/net/http/tinygo.go index c533127..d0f62c4 100644 --- a/net/http/tinygo.go +++ b/net/http/tinygo.go @@ -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)