File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -268,8 +268,10 @@ let axios = {
268268
269269 const xmlhttp = new XMLHttpRequest ( ) ;
270270
271- xmlhttp . onload = ( ) => {
272- resolve ( JSON . parse ( xmlhttp . responseText ) ) ;
271+ xmlhttp . onreadystatechange = ( ) => {
272+ if ( xmlhttp . readyState == 4 && ( xmlhttp . status == 201 || xmlhttp . status == 200 ) ) {
273+ resolve ( JSON . parse ( xmlhttp . responseText ) ) ;
274+ }
273275 } ;
274276
275277 xmlhttp . onerror = ( e ) => {
@@ -295,8 +297,10 @@ let axios = {
295297
296298 const xmlhttp = new XMLHttpRequest ( ) ;
297299
298- xmlhttp . onload = ( ) => {
299- resolve ( xmlhttp . responseText ) ;
300+ xmlhttp . onreadystatechange = ( ) => {
301+ if ( xmlhttp . readyState == 4 && ( xmlhttp . status == 201 || xmlhttp . status == 200 ) ) {
302+ resolve ( JSON . parse ( xmlhttp . responseText ) ) ;
303+ }
300304 } ;
301305
302306 xmlhttp . onerror = ( e ) => {
You can’t perform that action at this time.
0 commit comments