Skip to content

Commit 3e5b9cb

Browse files
committed
Use net/http instead of x/ctxhttp
Signed-off-by: Brian Goff <[email protected]>
1 parent 4c3926a commit 3e5b9cb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

client/request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/docker/docker/api/types"
1717
"github.com/docker/docker/api/types/versions"
1818
"github.com/pkg/errors"
19-
"golang.org/x/net/context/ctxhttp"
2019
)
2120

2221
// serverResponse is a wrapper for http API responses.
@@ -129,7 +128,8 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u
129128
func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResponse, error) {
130129
serverResp := serverResponse{statusCode: -1, reqURL: req.URL}
131130

132-
resp, err := ctxhttp.Do(ctx, cli.client, req)
131+
req = req.WithContext(ctx)
132+
resp, err := cli.client.Do(req)
133133
if err != nil {
134134
if cli.scheme != "https" && strings.Contains(err.Error(), "malformed HTTP response") {
135135
return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err)

0 commit comments

Comments
 (0)