Skip to content

Commit

Permalink
Merge pull request JSteunou#9 from NathanGloyn/set_heartbeat_via_headers
Browse files Browse the repository at this point in the history
Use heart-beat setting in headers
  • Loading branch information
JSteunou committed May 19, 2016
2 parents 8c5b283 + 242e15d commit 693b5d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ class Client {
this.ws.onopen = () => {
this.debug('Web Socket Opened...');
headers['accept-version'] = VERSIONS.supportedVersions();
headers['heart-beat'] = [this.heartbeat.outgoing, this.heartbeat.incoming].join(',');
// Check if we already have heart-beat in headers before adding them
if (!headers['heart-beat']) {
headers['heart-beat'] = [this.heartbeat.outgoing, this.heartbeat.incoming].join(',');
}
this._transmit('CONNECT', headers);
};
}
Expand Down

0 comments on commit 693b5d8

Please sign in to comment.