pretenderjs / FakeXMLHttpRequest

A fake XMLHttpRequest object for testing in browsers
MIT License
65 stars 46 forks source link

`onloadend` event not fired #28

Open jhilden opened 7 years ago

jhilden commented 7 years ago

Hi @trek et al, thanks a lot for your work on this.

We recently started using pretender as part of ember-cli-mirage in our Ember app and noticed that our HLS videos are not playing correctly anymore in development.

We have a passthrough rule in our mirage config for the domain where we load our HLS manifest files from and you can see them correctly being loaded in the network pane of the Chrome devtools, but HLS.js (the library we use) is still throwing a manifestLoadTimeOut error.

Investigation indicates that HLS.js is simply not clearing its internal timeout because the onloadend event is never called for the request.

It only happens in our development environment and HLS.js just seems to have moved to using onreadystatechange (https://github.com/dailymotion/hls.js/commit/55cabcf501034ac5901b98858bf68ee5af370c2a), so it is not criticial, but I wanted to report the issue anyway.

We are using mirage 0.2.1, pretender 1.1.0, and FakeXMLHttpRequest 1.4.0

Let me know if there are additional information that would be helpful for you.