Skip to content

Commit

Permalink
Remove Buffer() deprecation notice (#5942)
Browse files Browse the repository at this point in the history
  • Loading branch information
davimacedo authored and dplewis committed Aug 19, 2019
1 parent f25a846 commit c4e016e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Adapters/Storage/Mongo/MongoTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,7 @@ var BytesCoder = {
},

JSONToDatabase(json) {
return new mongodb.Binary(new Buffer(json.base64, 'base64'));
return new mongodb.Binary(Buffer.from(json.base64, 'base64'));
},

isValidJSON(value) {
Expand Down
4 changes: 2 additions & 2 deletions src/middlewares.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function handleParseHeaders(req, res, next) {
if (fileViaJSON) {
// We need to repopulate req.body with a buffer
var base64 = req.body.base64;
req.body = new Buffer(base64, 'base64');
req.body = Buffer.from(base64, 'base64');
}

const clientIp = getClientIp(req);
Expand Down Expand Up @@ -276,7 +276,7 @@ function httpAuth(req) {
}

function decodeBase64(str) {
return new Buffer(str, 'base64').toString();
return Buffer.from(str, 'base64').toString();
}

export function allowCrossDomain(req, res, next) {
Expand Down

0 comments on commit c4e016e

Please sign in to comment.