Skip to content

Commit ee3cc1f

Browse files
committed
Use js-base64 library
1 parent 54bd14d commit ee3cc1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/indexingapi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
require('isomorphic-fetch');
44
const Promise = require('es6-promise').Promise;
5-
5+
const { Base64 } = require('js-base64');
66

77
const BASE_URL = 'https://api.addsearch.com/v2/indices/';
88

99
const getHeaders = function(sitekey, privatekey) {
1010
return {
11-
'Authorization': 'Basic ' + Buffer.from(sitekey + ':' + privatekey).toString('base64'),
11+
'Authorization': 'Basic ' + Base64.encode(sitekey + ':' + privatekey),
1212
'Content-Type': 'application/json'
1313
};
1414
}

0 commit comments

Comments
 (0)