From 82824bc149550c96a5e915667a852de36aaee479 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Tue, 27 Feb 2018 21:56:14 +0100 Subject: [PATCH] [refactor] Use Buffer.concat([]) to construct an empty buffer --- lib/transports/polling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transports/polling.js b/lib/transports/polling.js index 6c5c0cc33..7c29c29ea 100644 --- a/lib/transports/polling.js +++ b/lib/transports/polling.js @@ -136,7 +136,7 @@ Polling.prototype.onDataRequest = function (req, res) { this.dataReq = req; this.dataRes = res; - var chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api + var chunks = isBinary ? Buffer.concat([]) : ''; var self = this; function cleanup () { @@ -162,7 +162,7 @@ Polling.prototype.onDataRequest = function (req, res) { } if (contentLength > self.maxHttpBufferSize) { - chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api + chunks = isBinary ? Buffer.concat([]) : ''; req.connection.destroy(); } }