diff --git a/form.js b/form.js index 904e284..02ad332 100644 --- a/form.js +++ b/form.js @@ -7,9 +7,9 @@ var qstr = require( "./querystr.js" ); module.exports = { form_multipart: function( boundary, request, handler ) { - boundary = new Buffer( "--" + boundary ); - var delim = new Buffer( "0D0A0D0A", "hex" ); - var endBuff = new Buffer( "2D2D0D0A", "hex" ); + boundary = Buffer.from( "--" + boundary ); + var delim = Buffer.from( "0D0A0D0A", "hex" ); + var endBuff = Buffer.from( "2D2D0D0A", "hex" ); var st = request.resultStream(); var firstRead = true; @@ -73,7 +73,7 @@ module.exports = { throw new Error( "Invalid form data" ); } - content = content.map( ( v ) => new Buffer( v ) ); + content = content.map( ( v ) => Buffer.from( v ) ); var item; var formData = [];