2
0
mirror of https://git.coolaj86.com/coolaj86/proxy-packer.js.git synced 2025-04-21 12:20:36 +00:00

v2.0.1: use Buffer.from() instead of new Buffer()

This commit is contained in:
AJ ONeal 2018-08-08 01:22:56 -06:00
parent ece89be3dd
commit 9241604639

View File

@ -211,7 +211,7 @@ Packer.packHeader = function (meta, data, service, andBody, oldways) {
data = Buffer.from(' '); data = Buffer.from(' ');
} }
if (data && !Buffer.isBuffer(data)) { if (data && !Buffer.isBuffer(data)) {
data = new Buffer(JSON.stringify(data)); data = Buffer.from(JSON.stringify(data));
} }
if (oldways && !data.byteLength) { if (oldways && !data.byteLength) {
data = Buffer.from(' '); data = Buffer.from(' ');