Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #979 from realityking/buffer-constructor
Browse files Browse the repository at this point in the history
chore: Don't use the deprecated Buffer constructor
  • Loading branch information
honzajavorek authored Mar 2, 2018
2 parents e46f225 + 5cfc39a commit 79a5eb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function applyConfiguration(config) {
configuration.options.method = configuration.options.method.map(method => method.toUpperCase());

if (configuration.options.user) {
const authHeader = `Authorization:Basic ${new Buffer(configuration.options.user).toString('base64')}`;
const authHeader = `Authorization:Basic ${Buffer.from(configuration.options.user).toString('base64')}`;
configuration.options.header.push(authHeader);
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/cli/cli-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ describe('CLI', () => {

it('should have an authorization header in the request', () => assert.isOk(runtimeInfo.server.requests['/machines'][0].headers.authorization));

it('should contain a base64 encoded string of the username and password', () => assert.isOk(runtimeInfo.server.requests['/machines'][0].headers.authorization === (`Basic ${new Buffer('username:password').toString('base64')}`)));
it('should contain a base64 encoded string of the username and password', () => assert.isOk(runtimeInfo.server.requests['/machines'][0].headers.authorization === (`Basic ${Buffer.from('username:password').toString('base64')}`)));
});


Expand Down

0 comments on commit 79a5eb7

Please sign in to comment.