Skip to content

Commit 1c24219

Browse files
committed
Use Buffer.from()
`new Buffer()` is deprecated and unsafe.
1 parent c58d365 commit 1c24219

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ HttpsProxyAgent.prototype.callback = function connect(req, opts, fn) {
204204
var headers = Object.assign({}, proxy.headers);
205205
if (proxy.auth) {
206206
headers['Proxy-Authorization'] =
207-
'Basic ' + new Buffer(proxy.auth).toString('base64');
207+
'Basic ' + Buffer.from(proxy.auth).toString('base64');
208208
}
209209

210210
// the Host header should only include the port

0 commit comments

Comments
 (0)