v2.0.1: use Buffer.from() instead of new Buffer()
This commit is contained in:
parent
ece89be3dd
commit
9241604639
2
index.js
2
index.js
|
@ -211,7 +211,7 @@ Packer.packHeader = function (meta, data, service, andBody, oldways) {
|
|||
data = Buffer.from(' ');
|
||||
}
|
||||
if (data && !Buffer.isBuffer(data)) {
|
||||
data = new Buffer(JSON.stringify(data));
|
||||
data = Buffer.from(JSON.stringify(data));
|
||||
}
|
||||
if (oldways && !data.byteLength) {
|
||||
data = Buffer.from(' ');
|
||||
|
|
Loading…
Reference in New Issue