Skip to content

Commit c218428

Browse files
1 parent 990c2a4 commit c218428

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"pretest": "npm run build",
4040
"test": "node test/index && node test/cache && node test/cache-invalidation && rimraf lib/cache"
4141
},
42+
"engines": {
43+
"node": ">=6.0.0"
44+
},
4245
"repository": {
4346
"type": "git",
4447
"url": "https://github.com/ForbesLindesay/http-basic.git"

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function _request(method: HttpVerb, url: string, options: Options, callback: Cal
7272
var rawHeaders = options.headers || {};
7373
var headers = caseless(rawHeaders);
7474
if (urlObject.auth) {
75-
headers.set('Authorization', 'Basic ' + (new Buffer(urlObject.auth)).toString('base64'));
75+
headers.set('Authorization', 'Basic ' + (Buffer.from(urlObject.auth)).toString('base64'));
7676
}
7777
var agent = 'agent' in options ? options.agent : false;
7878

0 commit comments

Comments
 (0)