diff options
Diffstat (limited to 'deps/npm/node_modules/request/lib')
-rw-r--r-- | deps/npm/node_modules/request/lib/helpers.js | 3 | ||||
-rw-r--r-- | deps/npm/node_modules/request/lib/multipart.js | 3 | ||||
-rw-r--r-- | deps/npm/node_modules/request/lib/oauth.js | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js index f9d727e382..05c77a0bdd 100644 --- a/deps/npm/node_modules/request/lib/helpers.js +++ b/deps/npm/node_modules/request/lib/helpers.js @@ -2,6 +2,7 @@ var jsonSafeStringify = require('json-stringify-safe') , crypto = require('crypto') + , Buffer = require('safe-buffer').Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick @@ -35,7 +36,7 @@ function isReadStream (rs) { } function toBase64 (str) { - return (new Buffer(str || '', 'utf8')).toString('base64') + return Buffer.from(str || '', 'utf8').toString('base64') } function copy (obj) { diff --git a/deps/npm/node_modules/request/lib/multipart.js b/deps/npm/node_modules/request/lib/multipart.js index 3b605bd47b..fc7b50276e 100644 --- a/deps/npm/node_modules/request/lib/multipart.js +++ b/deps/npm/node_modules/request/lib/multipart.js @@ -3,6 +3,7 @@ var uuid = require('uuid') , CombinedStream = require('combined-stream') , isstream = require('isstream') + , Buffer = require('safe-buffer').Buffer function Multipart (request) { @@ -71,7 +72,7 @@ Multipart.prototype.build = function (parts, chunked) { if (typeof part === 'number') { part = part.toString() } - return chunked ? body.append(part) : body.push(new Buffer(part)) + return chunked ? body.append(part) : body.push(Buffer.from(part)) } if (self.request.preambleCRLF) { diff --git a/deps/npm/node_modules/request/lib/oauth.js b/deps/npm/node_modules/request/lib/oauth.js index 56b39b0f51..13b693773e 100644 --- a/deps/npm/node_modules/request/lib/oauth.js +++ b/deps/npm/node_modules/request/lib/oauth.js @@ -6,6 +6,7 @@ var url = require('url') , uuid = require('uuid') , oauth = require('oauth-sign') , crypto = require('crypto') + , Buffer = require('safe-buffer').Buffer function OAuth (request) { @@ -70,7 +71,7 @@ OAuth.prototype.buildBodyHash = function(_oauth, body) { shasum.update(body || '') var sha1 = shasum.digest('hex') - return new Buffer(sha1).toString('base64') + return Buffer.from(sha1).toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { |