From 7b553cd374eab8ac7dcf97816d1fa3e597d3584b Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 21 Apr 2021 13:52:21 +0100 Subject: [PATCH] use v1 api for stream --- client/client.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index 0be46c9..499d10a 100644 --- a/client/client.go +++ b/client/client.go @@ -92,7 +92,8 @@ func (client *Client) Call(service, endpoint string, request, response interface if err != nil { return err } - // TODO: make optional + + // set the url to go through the v1 api uri.Path = "/v1/" + service + "/" + endpoint b, err := marshalRequest(service, endpoint, request) @@ -140,8 +141,9 @@ func (client *Client) Stream(service, endpoint string, request interface{}) (*St if err != nil { return nil, err } - // TODO: make optional - uri.Path = "/client/stream" + + // set the url to go through the v1 api + uri.Path = "/v1/" + service + "/" + endpoint // replace http with websocket uri.Scheme = strings.Replace(uri.Scheme, "http", "ws", 1)