File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ class REST extends Helper {
59
59
60
60
this . options = { ...this . options , ...config } ;
61
61
this . headers = { ...this . options . defaultHeaders } ;
62
- axios . defaults . headers = this . options . defaultHeaders ;
62
+ this . axios = axios . create ( ) ;
63
+ this . axios . defaults . headers = this . options . defaultHeaders ;
63
64
}
64
65
65
66
static _checkRequirements ( ) {
@@ -77,7 +78,7 @@ class REST extends Helper {
77
78
*/
78
79
async _executeRequest ( request ) {
79
80
const _debugRequest = { ...request } ;
80
- axios . defaults . timeout = request . timeout || this . options . timeout ;
81
+ this . axios . defaults . timeout = request . timeout || this . options . timeout ;
81
82
82
83
if ( this . headers && this . headers . auth ) {
83
84
request . auth = this . headers . auth ;
@@ -102,7 +103,7 @@ class REST extends Helper {
102
103
103
104
let response ;
104
105
try {
105
- response = await axios ( request ) ;
106
+ response = await this . axios ( request ) ;
106
107
} catch ( err ) {
107
108
if ( ! err . response ) throw err ;
108
109
this . debugSection ( 'Response' , `Response error. Status code: ${ err . response . status } ` ) ;
You can’t perform that action at this time.
0 commit comments