File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export class API {
108
108
message : res . data . faultstring || res . data ,
109
109
} ;
110
110
}
111
-
111
+
112
112
this . token = res . data ;
113
113
}
114
114
catch ( err ) {
@@ -192,7 +192,8 @@ export class API {
192
192
params : query ,
193
193
headers,
194
194
transformResponse : [ function transformResponse ( data , headers ) {
195
- if ( typeof data === 'string' && headers [ 'content-type' ] === 'application/json' ) {
195
+ if ( typeof data === 'string' && headers [ 'content-type' ] &&
196
+ headers [ 'content-type' ] . indexOf ( 'application/json' ) > - 1 ) {
196
197
try {
197
198
data = JSON . parse ( data ) ;
198
199
}
@@ -216,14 +217,14 @@ export class API {
216
217
} ,
217
218
// responseType: 'json',
218
219
} ;
219
-
220
+
220
221
if ( this . rejectUnauthorized === false ) {
221
222
process . env . NODE_TLS_REJECT_UNAUTHORIZED = '0' ;
222
223
}
223
224
else {
224
225
process . env . NODE_TLS_REJECT_UNAUTHORIZED = '1' ;
225
226
}
226
-
227
+
227
228
const response = await axios ( config ) ;
228
229
const contentType = ( response . headers || { } ) [ 'content-type' ] || [ ] ;
229
230
const requestId = ( response . headers || { } ) [ 'X-Request-ID' ] || null ;
You can’t perform that action at this time.
0 commit comments