Skip to content

Commit c5ce613

Browse files
committed
MINOR: service_discovery: add mode handling for consul api requests
1 parent ca4b0f6 commit c5ce613

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

discovery/consul_service_discovery_instance.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,12 @@ func (c *consulInstance) queryHealthService(se string, params *queryParams) ([]*
325325
}
326326

327327
func (c *consulInstance) doConsulQuery(method string, path string, params *queryParams, resp interface{}) (*queryMetadata, error) {
328+
mode := "http://"
329+
if c.params.Mode != nil {
330+
mode = fmt.Sprintf("%s://", *c.params.Mode)
331+
}
328332
fullPath, err := url.JoinPath(
329-
"http://",
333+
mode,
330334
net.JoinHostPort(*c.params.Address, strconv.FormatInt(*c.params.Port, 10)),
331335
path,
332336
)

0 commit comments

Comments
 (0)