From ad844f4b32a15f475f227a2b0277d6df2d063541 Mon Sep 17 00:00:00 2001 From: Oliver Salzburg Date: Tue, 18 Jun 2019 08:51:50 +0200 Subject: [PATCH 1/7] [fix] Deprecated Buffer usage in dependency (#585) The `Buffer` constructor has been deprecated in favor of safer alternatives. See https://nodejs.org/en/docs/guides/buffer-constructor-deprecation/ This was fixed in base64id@2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index caac4c850..0a93a82b9 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "license": "MIT", "dependencies": { "accepts": "~1.3.4", - "base64id": "1.0.0", + "base64id": "2.0.0", "debug": "~3.1.0", "engine.io-parser": "~2.1.0", "ws": "~6.1.0", From 5bbbfe241188b570c1a8417780baf81e344ce089 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 13 Sep 2019 10:26:18 +0200 Subject: [PATCH 2/7] [ci] remove Node.js 4 and 6 from the build matrix We keep Node.js 9 for compatibility with the 'uws' dependency (as Node.js 10 fails), but we'll upgrade later. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 968ece7d4..fbda89be8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ sudo: false language: node_js node_js: - - "4" - - "6" - "8" - "9" git: From a967626a1d1ec990090a63b4999337fd83abf223 Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov Date: Wed, 15 May 2019 22:55:56 +0300 Subject: [PATCH 3/7] [chore] Bump debug to version 4.1.0 (#581) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a93a82b9..018ed62b6 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "dependencies": { "accepts": "~1.3.4", "base64id": "2.0.0", - "debug": "~3.1.0", + "debug": "~4.1.0", "engine.io-parser": "~2.1.0", "ws": "~6.1.0", "cookie": "0.3.1" From c1448951334c7cfc5f1d1fff83c35117b6cf729f Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Fri, 13 Sep 2019 03:21:37 -0600 Subject: [PATCH 4/7] [feat] add additional debug messages (#586) These additional messages will help more quickly diagnose the reason for error messages. --- lib/server.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/server.js b/lib/server.js index df4058ea5..2d9a45c7a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -148,6 +148,7 @@ Server.prototype.verify = function (req, upgrade, fn) { var isOriginInvalid = checkInvalidHeaderChar(req.headers.origin); if (isOriginInvalid) { req.headers.origin = null; + debug('origin header invalid'); return fn(Server.errors.BAD_REQUEST, false); } @@ -155,6 +156,7 @@ Server.prototype.verify = function (req, upgrade, fn) { var sid = req._query.sid; if (sid) { if (!this.clients.hasOwnProperty(sid)) { + debug('unknown sid "%s"', sid); return fn(Server.errors.UNKNOWN_SID, false); } if (!upgrade && this.clients[sid].transport.name !== transport) { @@ -309,6 +311,7 @@ Server.prototype.handshake = function (transportName, req) { transport.supportsBinary = true; } } catch (e) { + debug('error handshaking to transport "%s"', transportName); sendErrorMessage(req, req.res, Server.errors.BAD_REQUEST); return; } @@ -552,23 +555,33 @@ function checkInvalidHeaderChar(val) { val += ''; if (val.length < 1) return false; - if (!validHdrChars[val.charCodeAt(0)]) + if (!validHdrChars[val.charCodeAt(0)]) { + debug('invalid header, index 0, char "%s"', val.charCodeAt(0)); return true; + } if (val.length < 2) return false; - if (!validHdrChars[val.charCodeAt(1)]) + if (!validHdrChars[val.charCodeAt(1)]) { + debug('invalid header, index 1, char "%s"', val.charCodeAt(1)); return true; + } if (val.length < 3) return false; - if (!validHdrChars[val.charCodeAt(2)]) + if (!validHdrChars[val.charCodeAt(2)]) { + debug('invalid header, index 2, char "%s"', val.charCodeAt(2)); return true; + } if (val.length < 4) return false; - if (!validHdrChars[val.charCodeAt(3)]) + if (!validHdrChars[val.charCodeAt(3)]) { + debug('invalid header, index 3, char "%s"', val.charCodeAt(3)); return true; + } for (var i = 4; i < val.length; ++i) { - if (!validHdrChars[val.charCodeAt(i)]) + if (!validHdrChars[val.charCodeAt(i)]) { + debug('invalid header, index "%i", char "%s"', i, val.charCodeAt(i)); return true; + } } return false; } From c471e03e09ce2201c8807fda94babf85455c4bb2 Mon Sep 17 00:00:00 2001 From: Yosi Attias Date: Mon, 12 Aug 2019 20:11:56 +0300 Subject: [PATCH 5/7] [chore] Bump `ws` to latest version (#587) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 018ed62b6..b235dab57 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,10 @@ "dependencies": { "accepts": "~1.3.4", "base64id": "2.0.0", + "cookie": "0.3.1", "debug": "~4.1.0", "engine.io-parser": "~2.1.0", - "ws": "~6.1.0", - "cookie": "0.3.1" + "ws": "^7.1.2" }, "devDependencies": { "babel-eslint": "^8.0.2", From 7bf75812c300aed1b62a10980c84187fddc2d346 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 13 Sep 2019 13:46:43 +0200 Subject: [PATCH 6/7] [chore] Bump engine.io-parser to version 2.2.0 Diff: https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b235dab57..a8e37e3fe 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "base64id": "2.0.0", "cookie": "0.3.1", "debug": "~4.1.0", - "engine.io-parser": "~2.1.0", + "engine.io-parser": "~2.2.0", "ws": "^7.1.2" }, "devDependencies": { From ecfcc69a7ae8c63dde8861a87715a8be718d510e Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 13 Sep 2019 13:51:49 +0200 Subject: [PATCH 7/7] [chore] Release 3.4.0 Diff: https://github.com/socketio/engine.io/compare/3.3.2...3.4.0 --- package.json | 4 ++-- test/engine.io.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a8e37e3fe..d99b2c31b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "engine.io", - "version": "3.3.2", + "version": "3.4.0", "description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", "main": "lib/engine.io", "author": "Guillermo Rauch ", @@ -35,7 +35,7 @@ "devDependencies": { "babel-eslint": "^8.0.2", "babel-preset-es2015": "^6.24.0", - "engine.io-client": "3.3.1", + "engine.io-client": "3.4.0", "eslint": "^4.5.0", "eslint-config-standard": "^10.2.1", "eslint-plugin-import": "^2.7.0", diff --git a/test/engine.io.js b/test/engine.io.js index c29d3934c..9387094c9 100644 --- a/test/engine.io.js +++ b/test/engine.io.js @@ -19,7 +19,7 @@ describe('engine', function () { expect(eio.protocol).to.be.a('number'); }); - it.skip('should be the same version as client', function () { + it('should be the same version as client', function () { var version = require('../package').version; expect(version).to.be(require('engine.io-client/package').version); });