tor-browser

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

send-authentication-prompt-manual.htm (1037B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <title>XMLHttpRequest: send() - "Basic" authentication gets 401 response</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/#the-send()-method" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
      8  </head>
      9  <body>
     10    <p>Please follow these steps to complete the test:</p>
     11    <ol>
     12      <li>If you are prompted for user name and password, type in 'usr' and 'secret'</li>
     13    </ol>
     14    <div id="log"></div>
     15    <script>
     16      test(function() {
     17        var client = new XMLHttpRequest(),
     18          urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/')
     19        client.open("GET", location.protocol+'//'+urlstart + "resources/auth5/auth.py", false, 'usr', 'wrongpassword')
     20        client.send(null)
     21        assert_equals(client.responseText, 'usr' + "\n" + 'secret')
     22      }, document.title)
     23    </script>
     24  </body>
     25 </html>