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(); } }