Skip to content

Fix passthrough issue for libraries using loadend instead of onreadystatechange (Axios)#355

Open
DrewCerny wants to merge 1 commit intopretenderjs:masterfrom
DrewCerny:master
Open

Fix passthrough issue for libraries using loadend instead of onreadystatechange (Axios)#355
DrewCerny wants to merge 1 commit intopretenderjs:masterfrom
DrewCerny:master

Conversation

@DrewCerny
Copy link
Copy Markdown

Issue #354 Fixed by adding loadend to the list of events watched by the passthrough

Comment thread src/create-passthrough.ts
export function createPassthrough(fakeXHR, nativeXMLHttpRequest) {
// event types to handle on the xhr
var evts = ['error', 'timeout', 'abort', 'readystatechange'];
var evts = ['error', 'timeout', 'abort', 'readystatechange','loadend'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var evts = ['error', 'timeout', 'abort', 'readystatechange','loadend'];
var evts = ['error', 'timeout', 'abort', 'readystatechange', 'loadend'];

@miguelsmatos
Copy link
Copy Markdown

This looks like a very simple fix to me, can we move forward with it?

@ailish-mccarthy-lrn
Copy link
Copy Markdown

Would be great to get this fix in!

@mark-barrett-lrn
Copy link
Copy Markdown

I agree with @ailish-mccarthy-lrn, this is such a simple fix that would unblock a lot of people. Lets get it merged 🚀

@michael-linnane-lrn
Copy link
Copy Markdown

Can this be actioned please. This can be a blocker for a lot of products using Axios

@hmust92
Copy link
Copy Markdown

hmust92 commented Jun 9, 2025

Yes please. Currently needing to implement a patch to add this. Would love for this to get merged in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants