send-authentication-prompt-2-manual.htm (1030B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: WWW-Authenticate challenge when user,pass are not passed to open()</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/auth6/auth.py", false) 20 client.send(null) 21 assert_equals(client.responseText, 'usr' + "\n" + 'secret') 22 }, document.title) 23 </script> 24 </body> 25 </html>