diff --git a/src/http-api.js b/src/http-api.js index 23006f35d..26b3d5f5b 100644 --- a/src/http-api.js +++ b/src/http-api.js @@ -271,10 +271,10 @@ MatrixHttpApi.prototype = { xhr.timeout_timer = callbacks.setTimeout(timeout_fn, 30000); xhr.onreadystatechange = function() { + let resp; switch (xhr.readyState) { case global.XMLHttpRequest.DONE: callbacks.clearTimeout(xhr.timeout_timer); - let resp; try { if (xhr.status === 0) { throw new AbortError();