File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- import Auth from '../api /Auth' ;
3
+ import Auth from './Auth' ;
4
4
import Embodied from '../api-query/Embodied' ;
5
5
import Filter from '../api-query/Filter' ;
6
6
import Query from '../api-query/Query' ;
@@ -415,7 +415,15 @@ class Launchpad {
415
415
clientRequest . header ( 'Authorization' , 'Bearer ' + this . auth_ . token ( ) ) ;
416
416
} else {
417
417
var credentials = this . auth_ . username ( ) + ':' + this . auth_ . password ( ) ;
418
- clientRequest . header ( 'Authorization' , 'Basic ' + btoa ( credentials ) ) ;
418
+ 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 ) ;
419
427
}
420
428
}
421
429
You can’t perform that action at this time.
0 commit comments