summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Guimard <yadd@debian.org>2021-08-29 02:59:48 +0200
committerJelmer Vernooij <jelmer@debian.org>2021-08-29 02:59:48 +0200
commit411d3ee4f9693dd2fe276ea1d8d051c88b399489 (patch)
tree41847ad7d2fbed7150b150c69274654607b982fe
parent4ba9c302b20526631d8987170293bffd56e4befc (diff)
replace Buffer() by Buffer.from()
Forwarded: no Last-Update: 2020-03-01 Gbp-Pq: Name fix-buffer-usage.diff
-rw-r--r--lib/node-rest-client.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/node-rest-client.js b/lib/node-rest-client.js
index dc6893d..1d6be05 100644
--- a/lib/node-rest-client.js
+++ b/lib/node-rest-client.js
@@ -64,7 +64,7 @@ exports.Client = function (options){
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 @@ exports.Client = function (options){
// 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 @@ exports.Client = function (options){
// concurrent data chunk handler
res.on('data',function(chunk){
- buffer.push(new Buffer(chunk));
+ buffer.push(new Buffer.from(chunk));
});
res.on('end',function(){