[19.03 backport] client: do not fallback to GET if HEAD on _ping fail to connect
| ... | ... |
@@ -31,6 +31,8 @@ func (cli *Client) Ping(ctx context.Context) (types.Ping, error) {
|
| 31 | 31 |
// Server handled the request, so parse the response |
| 32 | 32 |
return parsePingResponse(cli, serverResp) |
| 33 | 33 |
} |
| 34 |
+ } else if IsErrConnectionFailed(err) {
|
|
| 35 |
+ return ping, err |
|
| 34 | 36 |
} |
| 35 | 37 |
|
| 36 | 38 |
req, err = cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil)
|