Skip to content

Commit

Permalink
[refactor] Use Buffer.concat([]) to construct an empty buffer (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne authored Feb 27, 2018
1 parent 65b1ad1 commit be3833b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transports/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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();
}
}
Expand Down

0 comments on commit be3833b

Please sign in to comment.