Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough not working with axios 0.21.2+ #354

Open
DrewCerny opened this issue Jun 27, 2022 · 4 comments
Open

Passthrough not working with axios 0.21.2+ #354

DrewCerny opened this issue Jun 27, 2022 · 4 comments

Comments

@DrewCerny
Copy link

Axios has made a change in version 0.21.2 that no longer adds a handler for onreadystatechange if the browser supports onloadend. Since the passthrough logic does not watch for the loadend event it does not pass it through. The result is that axios requests that should passthrough just hang.

@vsergiu93
Copy link

Any news on this one?
Is there any way we can get the proposed fix merged?

@murashki
Copy link

murashki commented Nov 1, 2022

This bug could be fixed with this code. Note! You should require this code after const server = new Pretender();.

    const server = new Pretender();
    
    // FIX -->
    const NativeXMLHttpRequest = window.XMLHttpRequest;

    window.XMLHttpRequest = function XMLHttpRequest() {
      const request = new NativeXMLHttpRequest(arguments);
      delete request.onloadend;
      return request;
    };
    // <-- FIX

@lxulf
Copy link

lxulf commented Jan 30, 2023

Would be awesome to have this fixed! :)

@canyavall
Copy link

canyavall commented Jan 30, 2023

agree, some way we can push for it?

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

No branches or pull requests

5 participants