tor-browser

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

getallresponseheaders-status.htm (1162B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>XMLHttpRequest: getAllResponseHeaders() excludes status</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/#dom-xmlhttprequest-getallresponseheaders" data-tested-assertations="/following::OL[1]/LI[1] /following::OL[1]/LI[3]" />
      8  </head>
      9  <body>
     10    <div id="log"></div>
     11    <script>
     12      async_test(function() {
     13        var client = new XMLHttpRequest()
     14        assert_equals(client.getAllResponseHeaders(), "")
     15 
     16        client.onreadystatechange = this.step_func(function() {
     17          var headers = client.getAllResponseHeaders().toLowerCase()
     18          if(client.readyState == 1) {
     19            assert_equals(headers, "")
     20          }
     21          if(client.readyState > 1) {
     22            assert_false(headers.indexOf("200 ok") != -1)
     23            assert_false(headers.indexOf("http/1.") != -1)
     24          }
     25          if(client.readyState == 4)
     26            this.done()
     27        })
     28        client.open("GET", "resources/headers.py")
     29        client.send(null)
     30      })
     31  </script>
     32 </body>
     33 </html>