Fix long polling

This commit is contained in:
David Fowler 2016-10-01 15:48:15 -07:00
parent d646e3666f
commit 613ac2d6c3
1 changed files with 2 additions and 2 deletions

View File

@ -38,7 +38,7 @@
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
if (xhr.readyState == 4 && xhr.status == 200) { if (xhr.readyState == 4 && xhr.status == 200) {
sock.onmessage(xhr.responseText); sock.onmessage({ data: xhr.responseText });
poll(xhr); poll(xhr);
} }
} }
@ -69,7 +69,7 @@
sock.onopen(); sock.onopen();
poll(connectionId, new XMLHttpRequest()); poll(new XMLHttpRequest());
}); });
} }