Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 693b5d8

Browse files
committed
Merge pull request #9 from NathanGloyn/set_heartbeat_via_headers
Use heart-beat setting in headers
2 parents 8c5b283 + 242e15d commit 693b5d8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/client.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ class Client {
145145
this.ws.onopen = () => {
146146
this.debug('Web Socket Opened...');
147147
headers['accept-version'] = VERSIONS.supportedVersions();
148-
headers['heart-beat'] = [this.heartbeat.outgoing, this.heartbeat.incoming].join(',');
148+
// Check if we already have heart-beat in headers before adding them
149+
if (!headers['heart-beat']) {
150+
headers['heart-beat'] = [this.heartbeat.outgoing, this.heartbeat.incoming].join(',');
151+
}
149152
this._transmit('CONNECT', headers);
150153
};
151154
}

0 commit comments

Comments
 (0)