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

Commit 242e15d

Browse files
committed
Add check to see if user has already included heart beat information in headers before adding default values
1 parent 8c5b283 commit 242e15d

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)