Skip to content

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