tor-browser

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

test_bug380418.html (1462B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=380418 -->
      4 <head>
      5  <title>Test for Bug 380418</title>
      6  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      8 </head>
      9 <body>
     10 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=380418">Mozilla Bug 380418</a>
     11 <p id="display"></p>
     12 <div id="content" style="display: none">
     13 
     14 </div>
     15 <pre id="test">
     16 <script class="testbody" type="text/javascript">
     17 
     18  var request = new XMLHttpRequest();
     19  request.open("GET", window.location.href, false);
     20  request.send(null);
     21 
     22  // Try reading headers in unprivileged context
     23  is(request.getResponseHeader("Set-Cookie"), null, "Reading Set-Cookie response header in unprivileged context");
     24  is(request.getResponseHeader("Set-Cookie2"), null, "Reading Set-Cookie2 response header in unprivileged context");
     25  is(request.getResponseHeader("X-Dummy"), "test", "Reading X-Dummy response header in unprivileged context");
     26 
     27  ok(!/\bSet-Cookie:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie in all response headers in unprivileged context");
     28  ok(!/\bSet-Cookie2:/i.test(request.getAllResponseHeaders()), "Looking for Set-Cookie2 in all response headers in unprivileged context");
     29  ok(/\bX-Dummy:/i.test(request.getAllResponseHeaders()), "Looking for X-Dummy in all response headers in unprivileged context");
     30 
     31 </script>
     32 </pre>
     33 </body>
     34 </html>