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

Commit

Permalink
Publish version 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Steunou committed Jul 3, 2018
1 parent 76463fe commit deef583
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion dist/webstomp.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ return /******/ (function(modules) { // webpackBootstrap
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSupportedVersions = getSupportedVersions;
exports.unicodeStringToTypedArray = unicodeStringToTypedArray;
exports.typedArrayToUnicodeString = typedArrayToUnicodeString;
exports.sizeOfUTF8 = sizeOfUTF8;
Expand All @@ -106,6 +107,20 @@ var VERSIONS = exports.VERSIONS = {
}
};

var PROTOCOLS_VERSIONS = exports.PROTOCOLS_VERSIONS = {
'v10.stomp': VERSIONS.V1_0,
'v11.stomp': VERSIONS.V1_1,
'v12.stomp': VERSIONS.V1_2
};

function getSupportedVersions(protocol) {
var knownVersion = PROTOCOLS_VERSIONS[protocol];
if (!knownVersion) {
console.warn('DEPRECATED: ' + protocol + ' is not a recognized STOMP version. In next major client version, this will close the connection.');
}
return knownVersion || VERSIONS.supportedVersions();
}

// Define constants for bytes used throughout the code.
var BYTES = exports.BYTES = {
// LINEFEED byte (octet 10)
Expand Down Expand Up @@ -521,7 +536,7 @@ var Client = function () {
};
this.ws.onopen = function () {
_this.debug('Web Socket Opened...');
headers['accept-version'] = _utils.VERSIONS.supportedVersions();
headers['accept-version'] = (0, _utils.getSupportedVersions)(_this.ws.protocol);
// 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(',');
Expand Down
Loading

0 comments on commit deef583

Please sign in to comment.