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

fix close function to abort XHR #52

Merged
merged 1 commit into from
Feb 24, 2016

Conversation

brian-medendorp
Copy link

I noticed while using the polyfill, calling the close() function was not actually closing the http connection, but making this small change to call the abort() function of the actual xhr reference fixed the problem.

@brian-medendorp
Copy link
Author

I did attempt to write tests for this, but I couldn't find any existing tests of the close function, except for an assertion of the readyState after close() is called. There's no external reference to "req" or "xhr", so writing a test would likely involve mocking the entire http/https dependency, which seems a bit excessive for one line of code.

@aslakhellesoy aslakhellesoy merged commit fe88db8 into EventSource:master Feb 24, 2016
@aslakhellesoy
Copy link
Contributor

Thanks!

Yeah, it's harder to write tests for the polyfill - would be nice to have some automated tests running in an actual browser.

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.

2 participants