tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

send-redirect-bogus-sync.htm (1094B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>XMLHttpRequest: send() - Redirects (bogus Location header; sync)</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/#infrastructure-for-the-send()-method" data-tested-assertations="following::dl[1]/dt[2] following::dl[1]/dd[2]/ol/li[1] following::dl[1]/dd[2]/ol/li[3]" />
      8  </head>
      9  <body>
     10    <div id="log"></div>
     11    <script>
     12      function redirect(code, location) {
     13        test(function() {
     14          var client = new XMLHttpRequest()
     15          client.open("GET", "resources/redirect.py?location=" + location + "&code=" + code, false)
     16          assert_throws_dom("NetworkError", function() { client.send(null) })
     17        }, document.title + " (" + code + ": " + location + ")")
     18      }
     19      redirect("301", "foobar://abcd")
     20      redirect("302", "http://z.")
     21      redirect("302", "mailto:someone@example.org")
     22      redirect("303", "http://z.")
     23      redirect("303", "tel:1234567890")
     24    </script>
     25  </body>
     26 </html>