aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-24 09:48:23 -0500
committerAdnan Maolood <[email protected]>2021-02-24 09:48:23 -0500
commitbd29d76f668d29d5097c863a51bc1486f4edae88 (patch)
tree0b9b6862cd7df76fec152239b1d5e2fdf2ccfe83 /client.go
parentexamples/client: Use Response methods (diff)
downloadgo-gemini-bd29d76f668d29d5097c863a51bc1486f4edae88.tar.xz
go-gemini-bd29d76f668d29d5097c863a51bc1486f4edae88.zip
client: Fix copying of request
Diffstat (limited to 'client.go')
-rw-r--r--client.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/client.go b/client.go
index 2020e3d..86eb844 100644
--- a/client.go
+++ b/client.go
@@ -77,9 +77,10 @@ func (c *Client) Do(ctx context.Context, req *Request) (*Response, error) {
// Use the new URL in the request so that the server gets
// the punycoded hostname
- req = &Request{
- URL: u,
- }
+ r := new(Request)
+ *r = *req
+ r.URL = u
+ req = r
}
// Use request host if provided