diff --git a/client/consul.go b/client/consul.go index 5761321af..a87c9dad1 100644 --- a/client/consul.go +++ b/client/consul.go @@ -179,11 +179,11 @@ func (c *ConsulClient) makeChecks(service *structs.Service, ip string, port int) Interval: check.Interval.String(), Timeout: check.Timeout.String(), } - if check.Protocol == "" { - check.Protocol = "http" - } switch check.Type { case structs.ServiceCheckHTTP: + if check.Protocol == "" { + check.Protocol = "http" + } url := url.URL{ Scheme: check.Protocol, Host: fmt.Sprintf("%s:%d", ip, port),