diff --git a/index.js b/index.js index a3d6836..ae6c032 100644 --- a/index.js +++ b/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(' ');