tor-browser

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

test_XHR_header.html (858B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test for XMLHttpRequest.GetResponseHeader(foo) byte-inflates the output</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7  <meta charset="utf-8">
      8 </head>
      9 <body>
     10 <p id="display"></p>
     11 <div id="content" style="display: none">
     12 
     13 </div>
     14 <pre id="test">
     15 <script class="testbody" type="application/javascript">
     16 "use strict";
     17 SimpleTest.waitForExplicitFinish();
     18 
     19 let xhr = new XMLHttpRequest();
     20 xhr.open('GET', 'file_XHR_header.sjs', true);
     21 xhr.onreadystatechange = function() {
     22  if (xhr.readyState == 4) {
     23    ok(xhr.getResponseHeader('X-Custom-Header-Bytes') == "\xE2\x80\xA6",
     24       "getResponseHeader returns a string of the header's raw bytes");
     25    SimpleTest.finish();
     26  }
     27 }
     28 xhr.send(null);
     29 </script>
     30 </pre>
     31 </body>
     32 </html>