We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 728e4a2 commit 49b5b04Copy full SHA for 49b5b04
src/api/Launchpad.js
@@ -1,6 +1,6 @@
1
'use strict';
2
3
-import Auth from '../api/Auth';
+import Auth from './Auth';
4
import Embodied from '../api-query/Embodied';
5
import Filter from '../api-query/Filter';
6
import Query from '../api-query/Query';
@@ -415,7 +415,15 @@ class Launchpad {
415
clientRequest.header('Authorization', 'Bearer ' + this.auth_.token());
416
} else {
417
var credentials = this.auth_.username() + ':' + this.auth_.password();
418
- clientRequest.header('Authorization', 'Basic ' + btoa(credentials));
+ var basic;
419
+
420
+ if (typeof btoa === 'function') {
421
+ basic = btoa(credentials);
422
+ } else {
423
+ basic = new Buffer(credentials.toString(), 'binary');
424
+ }
425
426
+ clientRequest.header('Authorization', 'Basic ' + basic);
427
}
428
429
0 commit comments