Source code

Revision control

Copy as Markdown

Other Tools

<!doctype html>
<title>XMLHttpRequest: send() - "Basic" authenticated requests with user name and password from interactive session</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<link rel="help" href="" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." />
<p>Please follow these steps to complete the test:</p>
<script>var user = token();</script>
<li>Load <a href="resources/auth3/">page</a> and authenticate with username "<script>document.write(user)</script>" and password "pass"</li>
<li>Go back</li>
<li>Click <button onclick="location.href = location.href + '?dotest&user=' + user">complete test</button></li>
<div id="log"></div>
if ('?dotest') != -1) {
test(function() {
var user ='&user=') + 6),
client = new XMLHttpRequest(),
urlstart = + location.pathname.replace(/\/[^\/]*$/, '/')"GET", location.protocol+'//'+urlstart + "resources/auth3/", false)
assert_equals(client.responseText, user + "\n" + 'pass')
assert_equals(client.getResponseHeader('x-challenge'), 'DID-NOT')
}, document.title)