Browse code

Merge pull request #206 from thaJeztah/19.03_backport_no_retry_ping_on_errconn

[19.03 backport] client: do not fallback to GET if HEAD on _ping fail to connect

Sebastiaan van Stijn authored on 2019/05/24 05:48:02
Showing 1 changed files
... ...
@@ -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)