Skip to content

Commit

Permalink
already there
Browse files Browse the repository at this point in the history
  • Loading branch information
VinnyHC committed Feb 25, 2022
1 parent c69592e commit 9b5a79c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions api/client.go
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -1251,8 +1250,8 @@ START:

// requestWithContext avoids the use of the go-retryable library found in RawRequestWithContext and is
// useful when making requests where the req or resp body is likely larger than available memory
func (c *Client) requestWithContext(ctx context.Context, r *Request, body io.Reader) (*Response, error) {
req, err := http.NewRequestWithContext(ctx, r.Method, r.URL.RequestURI(), body)
func (c *Client) requestWithContext(ctx context.Context, r *Request) (*Response, error) {
req, err := http.NewRequestWithContext(ctx, r.Method, r.URL.RequestURI(), r.Body)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions api/sys_raft.go
Expand Up @@ -136,7 +136,7 @@ func (c *Sys) RaftSnapshot(snapWriter io.Writer) error {
r := c.c.NewRequest("GET", "/v1/sys/storage/raft/snapshot")
r.URL.RawQuery = r.Params.Encode()

resp, err := c.c.requestWithContext(context.Background(), r, nil)
resp, err := c.c.requestWithContext(context.Background(), r)
if err != nil {
return err
}
Expand Down Expand Up @@ -209,7 +209,7 @@ func (c *Sys) RaftSnapshotRestore(snapReader io.Reader, force bool) error {

r := c.c.NewRequest(http.MethodPost, path)

resp, err := c.c.requestWithContext(context.Background(), r, snapReader)
resp, err := c.c.requestWithContext(context.Background(), r)
if err != nil {
return err
}
Expand Down

0 comments on commit 9b5a79c

Please sign in to comment.