From 3e5b9cb46688ee5d6886ad3be4cb591f1ba49ed1 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 16 Oct 2018 09:44:53 -0700 Subject: [PATCH] Use net/http instead of x/ctxhttp Signed-off-by: Brian Goff --- client/request.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/request.go b/client/request.go index 9b8639a1e5..bf98962fcb 100644 --- a/client/request.go +++ b/client/request.go @@ -16,7 +16,6 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" "github.com/pkg/errors" - "golang.org/x/net/context/ctxhttp" ) // serverResponse is a wrapper for http API responses. @@ -129,7 +128,8 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResponse, error) { serverResp := serverResponse{statusCode: -1, reqURL: req.URL} - resp, err := ctxhttp.Do(ctx, cli.client, req) + req = req.WithContext(ctx) + resp, err := cli.client.Do(req) if err != nil { if cli.scheme != "https" && strings.Contains(err.Error(), "malformed HTTP response") { return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err)