File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
import core from 'bower:metal/src/core' ;
4
- import Auth from '../api/Auth' ;
4
+ import Auth from './Auth' ;
5
+ import Btoa from '../btoa/Btoa' ;
5
6
import Embodied from '../api-query/Embodied' ;
6
7
import Filter from '../api-query/Filter' ;
7
8
import Query from '../api-query/Query' ;
@@ -403,7 +404,7 @@ class Launchpad {
403
404
clientRequest . header ( 'Authorization' , 'Bearer ' + this . auth_ . token ( ) ) ;
404
405
} else {
405
406
var credentials = this . auth_ . username ( ) + ':' + this . auth_ . password ( ) ;
406
- clientRequest . header ( 'Authorization' , 'Basic ' + btoa ( credentials ) ) ;
407
+ clientRequest . header ( 'Authorization' , 'Basic ' + Btoa . btoa ( credentials ) ) ;
407
408
}
408
409
}
409
410
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ class Btoa {
4
+ static btoa ( stringToEncode ) {
5
+ if ( typeof btoa === 'function' ) {
6
+ return btoa ( stringToEncode ) ;
7
+ }
8
+
9
+ return new Buffer ( stringToEncode . toString ( ) , 'binary' ) ;
10
+ }
11
+ }
12
+
13
+ export default Btoa ;
You can’t perform that action at this time.
0 commit comments