send-redirect-infinite.htm (1548B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: send() - Redirects (infinite loop)</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onerror" data-tested-assertations="../.." /> 8 <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following::dl[1]/dt[2] following::dl[1]/dd[2]/p[1]" /> 9 <link rel="help" href="https://xhr.spec.whatwg.org/#network-error" data-tested-assertations=".." /> 10 <link rel="help" href="https://xhr.spec.whatwg.org/#request-error" data-tested-assertations="following::ol[1]/li[4] following::ol[1]/li[9] following::ol[1]/li[10]" /> 11 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetext-attribute" data-tested-assertations="following::ol[1]/li[3]" /> 12 </head> 13 <body> 14 <div id="log"></div> 15 <script> 16 var test = async_test() 17 var client = new XMLHttpRequest(), 18 errorEventFired = false, 19 code = 301 20 client.open("GET", "resources/infinite-redirects.py?type="+code) 21 client.onerror = function(){ 22 errorEventFired = true 23 } 24 client.onloadend = function(){ 25 test.step(function() { 26 assert_equals(errorEventFired, true) 27 assert_equals(client.responseText, '') 28 assert_equals(client.readyState, 4) 29 test.done() 30 }) 31 } 32 client.send(null) 33 </script> 34 </body> 35 </html>