summaryrefslogtreecommitdiff
path: root/internal/httpclient
diff options
context:
space:
mode:
Diffstat (limited to 'internal/httpclient')
-rw-r--r--internal/httpclient/client.go4
-rw-r--r--internal/httpclient/request.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/httpclient/client.go b/internal/httpclient/client.go
index b78dbc2d9..30ef0b04d 100644
--- a/internal/httpclient/client.go
+++ b/internal/httpclient/client.go
@@ -197,7 +197,7 @@ func (c *Client) Do(r *http.Request) (rsp *http.Response, err error) {
// If the fast-fail flag was set, just
// attempt a single iteration instead of
// following the below retry-backoff loop.
- rsp, _, err = c.DoOnce(&req)
+ rsp, _, err = c.DoOnce(req)
if err != nil {
return nil, fmt.Errorf("%w (fast fail)", err)
}
@@ -208,7 +208,7 @@ func (c *Client) Do(r *http.Request) (rsp *http.Response, err error) {
var retry bool
// Perform the http request.
- rsp, retry, err = c.DoOnce(&req)
+ rsp, retry, err = c.DoOnce(req)
if err == nil {
return rsp, nil
}
diff --git a/internal/httpclient/request.go b/internal/httpclient/request.go
index e5a7f44d3..dfe51b160 100644
--- a/internal/httpclient/request.go
+++ b/internal/httpclient/request.go
@@ -47,8 +47,8 @@ type Request struct {
// WrapRequest wraps an existing http.Request within
// our own httpclient.Request with retry / backoff tracking.
-func WrapRequest(r *http.Request) Request {
- var rr Request
+func WrapRequest(r *http.Request) *Request {
+ rr := new(Request)
rr.Request = r
entry := log.WithContext(r.Context())
entry = entry.WithField("method", r.Method)