File tree 1 file changed +17
-9
lines changed
1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -481,13 +481,21 @@ var client = function (config) {
481
481
* @param secretAccessKey
482
482
*/
483
483
exports . load = function ( cl , accessKeyId , secretAccessKey ) {
484
- var clients = cfg . clients ;
485
- if ( ! clients [ cl ] ) {
486
- throw new Error ( 'Invalid AWS client' ) ;
487
- }
488
- cl = client ( clients [ cl ] ) ;
489
- if ( accessKeyId && secretAccessKey ) {
490
- cl . setCredentials ( accessKeyId , secretAccessKey ) ;
491
- }
492
- return cl ;
484
+ var clientTemplate = cfg . clients [ cl ] ;
485
+ if ( ! clientTemplate ) {
486
+ throw new Error ( 'Invalid AWS client' ) ;
487
+ }
488
+
489
+ var result = client ( {
490
+ host : clientTemplate . host ,
491
+ prefix : clientTemplate . prefix ,
492
+ path : clientTemplate . host ,
493
+ query : clientTemplate . query
494
+ } ) ;
495
+
496
+ if ( accessKeyId && secretAccessKey ) {
497
+ result . setCredentials ( accessKeyId , secretAccessKey ) ;
498
+ }
499
+
500
+ return result ;
493
501
} ;
You can’t perform that action at this time.
0 commit comments