Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 800976e

Browse files
author
warner
committed
change deprecated Buffer calls
1 parent 4c63155 commit 800976e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var _ = require('lodash');
2121
*/
2222

2323
var encodeAuth = function(username, authkey){
24-
return (new Buffer(username+':'+authkey)).toString('base64');
24+
return (Buffer.from(username+':'+authkey)).toString('base64');
2525
}
2626

2727
var makeApiCall = function(server, method, path, qs, username, authkey, callback){

cbt_tunnels.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function cbtSocket(api, params) {
6767
}
6868

6969
var tType = self.tType = params.tType;
70-
self.auth_header = (new Buffer(params.username+':'+params.authkey)).toString('base64');
70+
self.auth_header = (Buffer.from(params.username+':'+params.authkey)).toString('base64');
7171
self.t = params.t;
7272
self.userId = params.userId;
7373
self.authkey = params.authkey;
@@ -82,7 +82,7 @@ function cbtSocket(api, params) {
8282
var proxyAuthString = self.proxyAuthString = '';
8383
self.nokill = params.nokill;
8484
if(!!params.proxyUser && !!params.proxyPass){
85-
proxyAuthString = self.proxyAuthString = 'Proxy-Authorization: Basic ' + (new Buffer(params.proxyUser + ':' + params.proxyPass)).toString('base64');
85+
proxyAuthString = self.proxyAuthString = 'Proxy-Authorization: Basic ' + (Buffer.from(params.proxyUser + ':' + params.proxyPass)).toString('base64');
8686
}
8787
self.ready = params.ready;
8888
switch(tType){
@@ -448,7 +448,7 @@ function cbtSocket(api, params) {
448448
}
449449
self.isTLSHello(connection_list[id],data.data,id,function(err){
450450
if(!err){
451-
var bufferToSend = new Buffer(data.data);
451+
var bufferToSend = Buffer.from(data.data);
452452
client.write(bufferToSend, function(err){
453453
if(err){
454454
global.logger.debug('Error writing data to: ');

0 commit comments

Comments
 (0)