Browse code

Use net/http instead of x/ctxhttp

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2018/10/17 01:44:53
Showing 1 changed files
... ...
@@ -16,7 +16,6 @@ import (
16 16
 	"github.com/docker/docker/api/types"
17 17
 	"github.com/docker/docker/api/types/versions"
18 18
 	"github.com/pkg/errors"
19
-	"golang.org/x/net/context/ctxhttp"
20 19
 )
21 20
 
22 21
 // serverResponse is a wrapper for http API responses.
... ...
@@ -129,7 +128,8 @@ func (cli *Client) sendRequest(ctx context.Context, method, path string, query u
129 129
 func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResponse, error) {
130 130
 	serverResp := serverResponse{statusCode: -1, reqURL: req.URL}
131 131
 
132
-	resp, err := ctxhttp.Do(ctx, cli.client, req)
132
+	req = req.WithContext(ctx)
133
+	resp, err := cli.client.Do(req)
133 134
 	if err != nil {
134 135
 		if cli.scheme != "https" && strings.Contains(err.Error(), "malformed HTTP response") {
135 136
 			return serverResp, fmt.Errorf("%v.\n* Are you trying to connect to a TLS-enabled daemon without TLS?", err)