From c4528cf0088dff5c927c3ca9d0e5d678c1f5c1fb Mon Sep 17 00:00:00 2001 From: Soren Nissen <67835328+skendanavian@users.noreply.github.com> Date: Sat, 13 Feb 2021 23:42:10 -0600 Subject: [PATCH] Fixed a deprecated buffer issue in Node.js. The pre-existing deprecated buffer results in package users never being able to authenticate their api keys. --- typingdnaclient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typingdnaclient.js b/typingdnaclient.js index 22efa84..2390cc2 100644 --- a/typingdnaclient.js +++ b/typingdnaclient.js @@ -44,7 +44,7 @@ var TypingDNAClient = function(apiKey, apiSecret, apiServer) { this.headers = { 'Content-Type': 'application/x-www-form-urlencoded', 'Cache-Control': 'no-cache', - 'Authorization': 'Basic ' + new Buffer(this.apiKey+':'+this.apiSecret).toString('base64') + 'Authorization': 'Basic ' + Buffer.from(this.apiKey+':'+this.apiSecret).toString('base64') }; this.server(apiServer); };