Skip to content

Commit

Permalink
Merge pull request #1885 from noelyoo/safe-buffer
Browse files Browse the repository at this point in the history
refactoring of new Buffer usage, which is deprecated and unsafe
  • Loading branch information
beatfactor committed Sep 21, 2018
2 parents eeb0a4f + d27d3c0 commit f626363
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/http/auth.js
Expand Up @@ -17,7 +17,7 @@ class Auth {
}

static toBase64(str) {
return new Buffer(str).toString('base64');
return Buffer.from(str).toString('base64');
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/src/index/testRequest.js
Expand Up @@ -105,7 +105,7 @@ describe('test HttpRequest', function() {
}).send();

try {
var authHeader = new Buffer('test:test-key').toString('base64');
var authHeader = Buffer.from('test:test-key').toString('base64');
assert.equal(request.httpRequest.getHeader('Authorization'), 'Basic ' + authHeader);
} catch (err) {
done(err);
Expand Down

0 comments on commit f626363

Please sign in to comment.