File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
packages/driver/src/cypress Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -344,20 +344,13 @@ export default class ProxyLogging {
344344 return debug ( 'unmatched responseReceived event %o' , responseReceived )
345345 }
346346
347- if ( proxyRequest . xhr && proxyRequest . xhr . xhr . readyState !== 4 ) {
348- const oldOnload = proxyRequest . xhr . xhr . onload
349- const proxyLogging = this
350-
351- proxyRequest . xhr . xhr . onload = function ( ...args ) {
352- if ( oldOnload ) {
353- oldOnload . call ( this , ...args )
354- }
355-
356- proxyLogging . updateProxyRequestWithResponse ( proxyRequest , responseReceived )
357- }
347+ if ( proxyRequest . xhr && proxyRequest . xhr . xhr . readyState !== XMLHttpRequest . DONE ) {
348+ proxyRequest . xhr . xhr . addEventListener ( 'load' , ( ) => {
349+ this . updateProxyRequestWithResponse ( proxyRequest , responseReceived )
350+ } )
351+ } else {
352+ this . updateProxyRequestWithResponse ( proxyRequest , responseReceived )
358353 }
359-
360- this . updateProxyRequestWithResponse ( proxyRequest , responseReceived )
361354 }
362355
363356 private updateRequestWithError ( error : RequestError ) : void {
You can’t perform that action at this time.
0 commit comments