Skip to content

Commit

Permalink
renaming better
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Alonso committed Aug 16, 2019
1 parent 3d32c90 commit c895dbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func errorSubscription(err error) *Subscription {
}
}

func (p *Client) Websocket(query string, requestHeader http.Header, options ...Option) *Subscription {
return p.WebsocketWithPayload(query, nil, requestHeader, options...)
func (p *Client) Websocket(query string, reqHeaders http.Header, options ...Option) *Subscription {
return p.WebsocketWithPayload(query, nil, reqHeaders, options...)
}

func (p *Client) WebsocketWithPayload(query string, initPayload map[string]interface{}, requestHeader http.Header, options ...Option) *Subscription {
func (p *Client) WebsocketWithPayload(query string, initPayload map[string]interface{}, reqHeaders http.Header, options ...Option) *Subscription {
r := p.mkRequest(query, options...)
requestBody, err := json.Marshal(r)
if err != nil {
Expand All @@ -53,7 +53,7 @@ func (p *Client) WebsocketWithPayload(query string, initPayload map[string]inter
url := strings.Replace(p.url, "http://", "ws://", -1)
url = strings.Replace(url, "https://", "wss://", -1)

c, resp, err := websocket.DefaultDialer.Dial(url, requestHeader)
c, resp, err := websocket.DefaultDialer.Dial(url, reqHeaders)
if err != nil {
return errorSubscription(fmt.Errorf("dial: %s", err.Error()))
}
Expand Down

0 comments on commit c895dbd

Please sign in to comment.