Fix timeouts
Showing
1 changed file
with
0 additions
and
8 deletions
... | @@ -42,13 +42,6 @@ | ... | @@ -42,13 +42,6 @@ |
42 | request.withCredentials = true; | 42 | request.withCredentials = true; |
43 | } | 43 | } |
44 | if (options.timeout) { | 44 | if (options.timeout) { |
45 | if (request.timeout === 0) { | ||
46 | request.timeout = options.timeout; | ||
47 | request.ontimeout = function() { | ||
48 | request.timedout = true; | ||
49 | }; | ||
50 | } else { | ||
51 | // polyfill XHR2 by aborting after the timeout | ||
52 | abortTimeout = window.setTimeout(function() { | 45 | abortTimeout = window.setTimeout(function() { |
53 | if (request.readyState !== 4) { | 46 | if (request.readyState !== 4) { |
54 | request.timedout = true; | 47 | request.timedout = true; |
... | @@ -56,7 +49,6 @@ | ... | @@ -56,7 +49,6 @@ |
56 | } | 49 | } |
57 | }, options.timeout); | 50 | }, options.timeout); |
58 | } | 51 | } |
59 | } | ||
60 | 52 | ||
61 | request.onreadystatechange = function() { | 53 | request.onreadystatechange = function() { |
62 | // wait until the request completes | 54 | // wait until the request completes | ... | ... |
-
Please register or sign in to post a comment