File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -127,18 +127,18 @@ export class HttpService {
127
127
...args : any [ ]
128
128
) {
129
129
return new Observable < AxiosResponse < T > > ( subscriber => {
130
- let config : AxiosRequestConfig = args [ args . length - 1 ] ;
131
- if ( ! config ) {
132
- config = { } ;
133
- }
130
+ const argsCopy = [ ... args ] ;
131
+ const configIdx = argsCopy . length - 1 ;
132
+ const config : AxiosRequestConfig = { ... ( argsCopy [ configIdx ] || { } ) } ;
133
+ argsCopy [ configIdx ] = config ;
134
134
135
135
let cancelSource : CancelTokenSource ;
136
136
if ( ! config . cancelToken ) {
137
137
cancelSource = Axios . CancelToken . source ( ) ;
138
138
config . cancelToken = cancelSource . token ;
139
139
}
140
140
141
- axios ( ...args )
141
+ axios ( ...argsCopy )
142
142
. then ( res => {
143
143
subscriber . next ( res ) ;
144
144
subscriber . complete ( ) ;
You can’t perform that action at this time.
0 commit comments