diff --git a/lib/OpenLayers/Request.js b/lib/OpenLayers/Request.js index a87664c5ee..81d8aeb4fb 100644 --- a/lib/OpenLayers/Request.js +++ b/lib/OpenLayers/Request.js @@ -169,7 +169,7 @@ OpenLayers.Request = { request.send(config.data); } else { window.setTimeout(function(){ - if (request._aborted !== true) { + if (request.readyState !== 0) { // W3C: 0-UNSENT request.send(config.data); } }, 0); diff --git a/tests/Request.html b/tests/Request.html index acdd8951d8..c1dcef2f51 100644 --- a/tests/Request.html +++ b/tests/Request.html @@ -409,6 +409,21 @@ }); } + function test_abort2(t) { + t.plan(0); + var fail = false; + OpenLayers.Request.XMLHttpRequest.onsend = function(args) { + fail = true; + } + t.delay_call(0.5, function() { + if (fail === true) { + t.fail("Send should not be called because request is aborted"); + } + OpenLayers.Request.XMLHttpRequest.onsend = null; + }); + var req = OpenLayers.Request.GET(); + req.abort(); + }