Description: replace Buffer() by Buffer.from()
Author: Xavier Guimard <yadd@debian.org>
Forwarded: no
Last-Update: 2020-03-01

--- a/lib/node-rest-client.js
+++ b/lib/node-rest-client.js
@@ -64,7 +64,7 @@
 		var result ={};
 		// if proxy requires authentication, create Proxy-Authorization headers
 		if (self.proxy.user && self.proxy.password){
-			result["Proxy-Authorization"] = "Basic " + new Buffer([self.proxy.user,self.proxy.password].join(":")).toString("base64");
+			result["Proxy-Authorization"] = "Basic " + new Buffer.from([self.proxy.user,self.proxy.password].join(":")).toString("base64");
 		}
 		// no tunnel proxy connection, we add the host to the headers
 		if(!self.useProxyTunnel)
@@ -497,7 +497,7 @@
 
 						// concurrent data chunk handler
 						res.on('data',function(chunk){
-							buffer.push(new Buffer(chunk));
+							buffer.push(new Buffer.from(chunk));
 						});
 
 						res.on('end',function(){
@@ -583,7 +583,7 @@
 
 						// concurrent data chunk handler
 						res.on('data',function(chunk){
-							buffer.push(new Buffer(chunk));
+							buffer.push(new Buffer.from(chunk));
 						});
 
 						res.on('end',function(){
