Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Commit

Permalink
Reset onReadyStateChange handler before abort() to avoid success hand…
Browse files Browse the repository at this point in the history
…ler invocation on timeout
  • Loading branch information
pronebird committed Feb 1, 2012
1 parent a05d1cd commit 643791c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cors/index.html
Expand Up @@ -113,9 +113,9 @@
// set a timeout
var timeout;
timeout = setTimeout(function(){
req.abort();
// reset the handler
req.onreadystatechange = Function.prototype;
req.abort();
req = null;
error({
message: "timeout after " + config.timeout + " second",
Expand Down

0 comments on commit 643791c

Please sign in to comment.