| Hallvord Reiar M. Steen | e2795e3 | 2013-05-28 13:59:42 | [diff] [blame] | 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> |
| Ms2ger | 91fef14 | 2014-11-01 09:24:37 | [diff] [blame] | 7 | <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following::code[contains(@title,'http-authorization')]/.." /> |
| Hallvord Reiar M. Steen | e2795e3 | 2013-05-28 13:59:42 | [diff] [blame] | 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(/\/[^\/]*$/, '/') |
| James Graham | 234a672 | 2013-09-17 17:54:38 | [diff] [blame] | 19 | client.open("GET", location.protocol+'//'+urlstart + "resources/auth6/auth.py", false) |
| Hallvord Reiar M. Steen | e2795e3 | 2013-05-28 13:59:42 | [diff] [blame] | 20 | client.send(null) |
| 21 | assert_equals(client.responseText, 'usr' + "\n" + 'secret') |
| 22 | }, document.title) |
| 23 | </script> |
| 24 | </body> |
| 25 | </html> |