Skip to content

Commit be3833b

Browse files
[refactor] Use Buffer.concat([]) to construct an empty buffer (#555)
1 parent 65b1ad1 commit be3833b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/transports/polling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Polling.prototype.onDataRequest = function (req, res) {
136136
this.dataReq = req;
137137
this.dataRes = res;
138138

139-
var chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
139+
var chunks = isBinary ? Buffer.concat([]) : '';
140140
var self = this;
141141

142142
function cleanup () {
@@ -162,7 +162,7 @@ Polling.prototype.onDataRequest = function (req, res) {
162162
}
163163

164164
if (contentLength > self.maxHttpBufferSize) {
165-
chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
165+
chunks = isBinary ? Buffer.concat([]) : '';
166166
req.connection.destroy();
167167
}
168168
}

0 commit comments

Comments
 (0)