File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,19 @@ export default function (apiPath, params = {}) {
99 if ( ! process . env [ 'BROWSERSTACK_USERNAME' ] || ! process . env [ 'BROWSERSTACK_ACCESS_KEY' ] )
1010 throw new Error ( ERROR_MESSAGES . BROWSERSTACK_AUTHENTICATION_FAILED ( ) ) ;
1111
12- var url = apiPath . url ;
13-
1412 var { body, executeImmediately, ...queryParams } = params ;
1513
1614 var opts = {
15+ url : apiPath . url ,
1716 auth : {
1817 user : process . env [ 'BROWSERSTACK_USERNAME' ] ,
1918 pass : process . env [ 'BROWSERSTACK_ACCESS_KEY' ] ,
2019 } ,
2120
21+ headers : {
22+ 'user-agent' : 'testcafe-browserstack' ,
23+ } ,
24+
2225 qs : { ...queryParams } ,
2326
2427 method : apiPath . method || 'GET' ,
@@ -34,7 +37,7 @@ export default function (apiPath, params = {}) {
3437 const chainPromise = executeImmediately ? Promise . resolve ( null ) : apiRequestPromise ;
3538
3639 const currentRequestPromise = chainPromise
37- . then ( ( ) => request ( url , opts ) )
40+ . then ( ( ) => request ( opts ) )
3841 . catch ( error => {
3942 if ( error . statusCode === 401 )
4043 throw new Error ( ERROR_MESSAGES . BROWSERSTACK_AUTHENTICATION_FAILED ( ) ) ;
You can’t perform that action at this time.
0 commit comments